Skip to content

Commit

Permalink
finished TwitterSearch test-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoepp committed Jul 13, 2013
1 parent 19e242b commit f3e204b
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TwitterSearch
[![Build](https://api.travis-ci.org/ckoepp/TwitterSearch.png?branch=master)](https://travis-ci.org/ckoepp/TwitterSearch) [![Downloads](https://pypip.in/d/TwitterSearch/badge.png)](https://crate.io/packages/TwitterSearch/) [![PyPI version](https://pypip.in/v/TwitterSearch/badge.png)](https://crate.io/packages/TwitterSearch/)
[![Build](https://api.travis-ci.org/ckoepp/TwitterSearch.png?branch=master)](https://travis-ci.org/ckoepp/TwitterSearch/branches) [![Downloads](https://pypip.in/d/TwitterSearch/badge.png)](https://crate.io/packages/TwitterSearch/) [![PyPI version](https://pypip.in/v/TwitterSearch/badge.png)](https://crate.io/packages/TwitterSearch/)


This library allows you easily create a search through the Twitter Search API without having to know too much about the API details. Based on such a search you can even iterate throughout all tweets reachable via the Twitter Search API. There is an automatic reload of the next pages while using the iteration.
Expand Down
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ def readme():
'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries',
],
install_requires=[
'requests',
'requests-oauthlib',
'requests >= 1.0.0',
'requests-oauthlib >= 0.3.0',
],
zip_safe=False)
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'nose-cover3', 'httpretty']
)
2 changes: 1 addition & 1 deletion tests/mock-data/3.log
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"statuses":[{"metadata":{"result_type":"recent","iso_language_code":"es"},"created_at":"Fri Jul 12 15:36:23 +0000 2013","id":355712247407968257,"id_str":"355712247407968257","text":"La Universidad de Heidelberg y Banco Santander ampl\u00edan su colaboraci\u00f3n en Latinoam\u00e9rica, Europa y Asia http:\/\/t.co\/aqEQhbvXtz","source":"\u003ca href=\"http:\/\/dlvr.it\" rel=\"nofollow\"\u003edlvr.it\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":18465093,"id_str":"18465093","name":"AGARESO ","screen_name":"agareso","location":"Galicia (Espa\u00f1a)","description":"AGARESO, la Asociaci\u00f3n Galega de Reporteiros Solidarios, somos profesionales del mundo de la comunicaci\u00f3n implicados en proyectos de cooperaci\u00f3n y solidaridad","url":"http:\/\/t.co\/33yu5yy9r3","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/33yu5yy9r3","expanded_url":"http:\/\/www.agareso.org\/","display_url":"agareso.org","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":2401,"friends_count":2060,"listed_count":167,"created_at":"Tue Dec 30 01:05:06 +0000 2008","favourites_count":1,"utc_offset":3600,"time_zone":"Madrid","geo_enabled":true,"verified":false,"statuses_count":11327,"lang":"es","contributors_enabled":false,"is_translator":false,"profile_background_color":"DAF8A0","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/3854666\/logoagareso3.gif","profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/3854666\/logoagareso3.gif","profile_background_tile":true,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/68959420\/logoagareso1_normal.jpg","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/68959420\/logoagareso1_normal.jpg","profile_link_color":"30199A","profile_sidebar_border_color":"397033","profile_sidebar_fill_color":"91D035","profile_text_color":"080807","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"es"},{"metadata":{"result_type":"recent","iso_language_code":"de"},"created_at":"Fri Jul 12 15:36:06 +0000 2013","id":355712176922705920,"id_str":"355712176922705920","text":"1. CSR Tag \/ 5. Marktplatz Gute Geschaefte Heidelberg am 09.07.2013: http:\/\/t.co\/3V7UOILGvw \u00fcber @YouTube","source":"\u003ca href=\"http:\/\/www.google.com\/\" rel=\"nofollow\"\u003eGoogle\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":195477393,"id_str":"195477393","name":"FreiwilligenB\u00f6rse","screen_name":"engagiert_in_hd","location":"Heidelberg","description":"engagieren leicht gemacht ist das Motto der FreiwilligenB\u00f6rse: wir beraten Menschen, die sich freiwillig\/ehrenamtlich engagieren m\u00f6chten und vieles mehr ...","url":"http:\/\/t.co\/j8wC0O24d1","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/j8wC0O24d1","expanded_url":"http:\/\/www.freiwilligenboerse-heidelberg.de","display_url":"freiwilligenboerse-heidelberg.de","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":145,"friends_count":138,"listed_count":13,"created_at":"Sun Sep 26 20:19:13 +0000 2010","favourites_count":0,"utc_offset":3600,"time_zone":"Berlin","geo_enabled":false,"verified":false,"statuses_count":72,"lang":"de","contributors_enabled":false,"is_translator":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/154992104\/FWB_Logo_4c_1.jpg","profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/154992104\/FWB_Logo_4c_1.jpg","profile_background_tile":true,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/1133023594\/FWB_Logo_4c_1_normal.jpg","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/1133023594\/FWB_Logo_4c_1_normal.jpg","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"de"},{"metadata":{"result_type":"recent","iso_language_code":"de"},"created_at":"Fri Jul 12 15:30:59 +0000 2013","id":355710890307354627,"id_str":"355710890307354627","text":"MORGEN!Top bezahlte Aktion am 13.07 in PLZ 68xxx Heidelberg! http:\/\/t.co\/DIT7ccOSzQ #promojob","source":"\u003ca href=\"http:\/\/twitterfeed.com\" rel=\"nofollow\"\u003etwitterfeed\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":72517715,"id_str":"72517715","name":"promotionbasis","screen_name":"promotionjob","location":"Kiel, Germany","description":"Job-Kanal der gro\u00dfen deutschsprachigen Ressource f\u00fcr Infos und Jobs rund um Promotion, Messen und Events.\r\nCheck out: @promotionbasis \/ @promojob","url":"http:\/\/t.co\/VYID51nLh6","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/VYID51nLh6","expanded_url":"http:\/\/impressum.promotionbasis.de","display_url":"impressum.promotionbasis.de","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":555,"friends_count":67,"listed_count":15,"created_at":"Tue Sep 08 09:55:41 +0000 2009","favourites_count":0,"utc_offset":3600,"time_zone":"Berlin","geo_enabled":false,"verified":false,"statuses_count":97145,"lang":"de","contributors_enabled":false,"is_translator":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/208312243\/PB_promotionjob_2011-02.jpg","profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/208312243\/PB_promotionjob_2011-02.jpg","profile_background_tile":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/772180561\/PB_-_Logo_-_Twitter_normal.jpg","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/772180561\/PB_-_Logo_-_Twitter_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/72517715\/1372840454","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"de"}],"search_metadata":{"completed_in":0.066,"max_id":355712782454358015,"max_id_str":"355712782454358015","next_results":"?max_id=355710867087704064&q=Heidelberg&count=4","query":"Heidelberg","refresh_url":"?since_id=355712782454358015&q=Heidelberg","count":4,"since_id":0,"since_id_str":"0"}}
{"statuses":[{"metadata":{"result_type":"recent","iso_language_code":"es"},"created_at":"Fri Jul 12 15:36:23 +0000 2013","id":355712247407968257,"id_str":"355712247407968257","text":"La Universidad de Heidelberg y Banco Santander ampl\u00edan su colaboraci\u00f3n en Latinoam\u00e9rica, Europa y Asia http:\/\/t.co\/aqEQhbvXtz","source":"\u003ca href=\"http:\/\/dlvr.it\" rel=\"nofollow\"\u003edlvr.it\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":18465093,"id_str":"18465093","name":"AGARESO ","screen_name":"agareso","location":"Galicia (Espa\u00f1a)","description":"AGARESO, la Asociaci\u00f3n Galega de Reporteiros Solidarios, somos profesionales del mundo de la comunicaci\u00f3n implicados en proyectos de cooperaci\u00f3n y solidaridad","url":"http:\/\/t.co\/33yu5yy9r3","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/33yu5yy9r3","expanded_url":"http:\/\/www.agareso.org\/","display_url":"agareso.org","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":2401,"friends_count":2060,"listed_count":167,"created_at":"Tue Dec 30 01:05:06 +0000 2008","favourites_count":1,"utc_offset":3600,"time_zone":"Madrid","geo_enabled":true,"verified":false,"statuses_count":11327,"lang":"es","contributors_enabled":false,"is_translator":false,"profile_background_color":"DAF8A0","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/3854666\/logoagareso3.gif","profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/3854666\/logoagareso3.gif","profile_background_tile":true,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/68959420\/logoagareso1_normal.jpg","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/68959420\/logoagareso1_normal.jpg","profile_link_color":"30199A","profile_sidebar_border_color":"397033","profile_sidebar_fill_color":"91D035","profile_text_color":"080807","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"es"},{"metadata":{"result_type":"recent","iso_language_code":"de"},"created_at":"Fri Jul 12 15:36:06 +0000 2013","id":355712176922705920,"id_str":"355712176922705920","text":"1. CSR Tag \/ 5. Marktplatz Gute Geschaefte Heidelberg am 09.07.2013: http:\/\/t.co\/3V7UOILGvw \u00fcber @YouTube","source":"\u003ca href=\"http:\/\/www.google.com\/\" rel=\"nofollow\"\u003eGoogle\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":195477393,"id_str":"195477393","name":"FreiwilligenB\u00f6rse","screen_name":"engagiert_in_hd","location":"Heidelberg","description":"engagieren leicht gemacht ist das Motto der FreiwilligenB\u00f6rse: wir beraten Menschen, die sich freiwillig\/ehrenamtlich engagieren m\u00f6chten und vieles mehr ...","url":"http:\/\/t.co\/j8wC0O24d1","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/j8wC0O24d1","expanded_url":"http:\/\/www.freiwilligenboerse-heidelberg.de","display_url":"freiwilligenboerse-heidelberg.de","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":145,"friends_count":138,"listed_count":13,"created_at":"Sun Sep 26 20:19:13 +0000 2010","favourites_count":0,"utc_offset":3600,"time_zone":"Berlin","geo_enabled":false,"verified":false,"statuses_count":72,"lang":"de","contributors_enabled":false,"is_translator":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/154992104\/FWB_Logo_4c_1.jpg","profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/154992104\/FWB_Logo_4c_1.jpg","profile_background_tile":true,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/1133023594\/FWB_Logo_4c_1_normal.jpg","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/1133023594\/FWB_Logo_4c_1_normal.jpg","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"de"},{"metadata":{"result_type":"recent","iso_language_code":"de"},"created_at":"Fri Jul 12 15:30:59 +0000 2013","id":355710890307354627,"id_str":"355710890307354627","text":"MORGEN!Top bezahlte Aktion am 13.07 in PLZ 68xxx Heidelberg! http:\/\/t.co\/DIT7ccOSzQ #promojob","source":"\u003ca href=\"http:\/\/twitterfeed.com\" rel=\"nofollow\"\u003etwitterfeed\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":72517715,"id_str":"72517715","name":"promotionbasis","screen_name":"promotionjob","location":"Kiel, Germany","description":"Job-Kanal der gro\u00dfen deutschsprachigen Ressource f\u00fcr Infos und Jobs rund um Promotion, Messen und Events.\r\nCheck out: @promotionbasis \/ @promojob","url":"http:\/\/t.co\/VYID51nLh6","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/VYID51nLh6","expanded_url":"http:\/\/impressum.promotionbasis.de","display_url":"impressum.promotionbasis.de","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":555,"friends_count":67,"listed_count":15,"created_at":"Tue Sep 08 09:55:41 +0000 2009","favourites_count":0,"utc_offset":3600,"time_zone":"Berlin","geo_enabled":false,"verified":false,"statuses_count":97145,"lang":"de","contributors_enabled":false,"is_translator":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/208312243\/PB_promotionjob_2011-02.jpg","profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/208312243\/PB_promotionjob_2011-02.jpg","profile_background_tile":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/772180561\/PB_-_Logo_-_Twitter_normal.jpg","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/772180561\/PB_-_Logo_-_Twitter_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/72517715\/1372840454","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"de"}],"search_metadata":{"completed_in":0.066,"max_id":355712782454358015,"max_id_str":"355712782454358015","next_results":"?max_id=355710867087704064&q=Heidelberg&count=4","query":"Heidelberg","refresh_url":"?since_id=355712782454358015&q=Heidelberg","count":3,"since_id":0,"since_id_str":"0"}}
Loading

0 comments on commit f3e204b

Please sign in to comment.