From 33a935f0606931c18541d2460ee08a31cc6d6d9f Mon Sep 17 00:00:00 2001 From: Daniel Croak Date: Tue, 30 Jun 2009 14:20:57 -0400 Subject: [PATCH] all tests now running off json & Fakeweb instead of yaml files --- test/foreign_languages_test.rb | 2 +- test/json/beer_minus_root.json | 20 ++++ test/json/flight_negative_tude.json | 20 ++++ test/json/from_alexiskold.json | 20 ++++ test/json/ftw_until.json | 20 ++++ test/json/happy_hour_exact.json | 20 ++++ test/json/hashtag_haiku.json | 20 ++++ test/json/hilarious_links.json | 20 ++++ test/json/movie_positive_tude.json | 20 ++++ test/json/obama_or_hillary.json | 20 ++++ test/json/only_one_result.json | 20 ++++ test/json/page_one.json | 20 ++++ test/json/page_two.json | 20 ++++ test/json/reference_mashable.json | 20 ++++ test/json/results_per_page.json | 20 ++++ test/json/superhero_since.json | 20 ++++ test/json/to_techcrunch.json | 20 ++++ test/json/traffic_question.json | 20 ++++ test/operators_test.rb | 139 +++++++++++++++++++--------- test/pagination_test.rb | 30 ++++-- test/search_test.rb | 10 +- test/test_helper.rb | 13 +-- test/trends_test.rb | 2 +- 23 files changed, 469 insertions(+), 67 deletions(-) create mode 100644 test/json/beer_minus_root.json create mode 100644 test/json/flight_negative_tude.json create mode 100644 test/json/from_alexiskold.json create mode 100644 test/json/ftw_until.json create mode 100644 test/json/happy_hour_exact.json create mode 100644 test/json/hashtag_haiku.json create mode 100644 test/json/hilarious_links.json create mode 100644 test/json/movie_positive_tude.json create mode 100644 test/json/obama_or_hillary.json create mode 100644 test/json/only_one_result.json create mode 100644 test/json/page_one.json create mode 100644 test/json/page_two.json create mode 100644 test/json/reference_mashable.json create mode 100644 test/json/results_per_page.json create mode 100644 test/json/superhero_since.json create mode 100644 test/json/to_techcrunch.json create mode 100644 test/json/traffic_question.json diff --git a/test/foreign_languages_test.rb b/test/foreign_languages_test.rb index 929e47f..5f5cc34 100644 --- a/test/foreign_languages_test.rb +++ b/test/foreign_languages_test.rb @@ -1,7 +1,7 @@ require File.join(File.dirname(__FILE__), 'test_helper') class ForeignLanguagesTest < Test::Unit::TestCase # :nodoc: - context "client.query(:q => 'congratulations', :lang => 'en')" do + context "english" do setup do query = { :q => 'congratulations', :lang => 'en' } fake_query(query, 'english.json') diff --git a/test/json/beer_minus_root.json b/test/json/beer_minus_root.json new file mode 100644 index 0000000..3c9da62 --- /dev/null +++ b/test/json/beer_minus_root.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:04:54 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb003 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb003.twitter.com +Expires: Tue, 30 Jun 2009 15:09:54 GMT +Content-Length: 7034 +Vary: Accept-Encoding +X-Varnish: 1887432816 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb003.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"R, home sweet home. Without any further a do, I gonna try some of my home made beer. Today's the day it's ready.","to_user_id":null,"from_user":"eco_retro","id":2404598347,"from_user_id":16300155,"iso_language_code":"en","source":"<a href="http:\/\/www.twhirl.org\/">twhirl<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/252066475\/tweetpic2_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:40 +0000"},{"text":"@ellaabi Once there's beer n stuff.","to_user_id":25168640,"to_user":"ellaabi","from_user":"larjudge","id":2404596615,"from_user_id":11806192,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/196419446\/avtr_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:33 +0000"},{"text":"@ya_ko thanks! yeah, let's go for some cold beer!","to_user_id":5375,"to_user":"Ya_ko","from_user":"nealsato","id":2404596156,"from_user_id":173501,"iso_language_code":"en","source":"<a href="http:\/\/desktop.seesmic.com\/">Seesmic Desktop<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/52108672\/neal_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:31 +0000"},{"text":"Support Finnegans.org by their beer","to_user_id":null,"from_user":"InternetJunkee","id":2404594754,"from_user_id":24711327,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/134891444\/Me_1_normal.JPG","created_at":"Tue, 30 Jun 2009 15:04:25 +0000"},{"text":"@ReeseLP Yea homie it was ROUGH beer pong all night I was ALLEN IVERSON SON!! LOL","to_user_id":9820644,"to_user":"ReeseLP","from_user":"TheeKoolestKid","id":2404591401,"from_user_id":18162717,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/223913615\/WORD_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:11 +0000"},{"text":"Long and hot day at work. Going for a cold beer now!","to_user_id":null,"from_user":"Dyppe","id":2404590897,"from_user_id":4756705,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/79704489\/recut_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:09 +0000"},{"text":"@browntown big beer holiday so no bars 2day mainly grocery & conv. stores","to_user_id":409097,"to_user":"browntown","from_user":"djacra","id":2404590895,"from_user_id":13510637,"iso_language_code":"en","source":"<a href="http:\/\/twitterhelp.blogspot.com\/2008\/05\/twitter-via-mobile-web-mtwittercom.html">mobile web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/180129385\/Venice_66_256_normal.JPG","created_at":"Tue, 30 Jun 2009 15:04:09 +0000"},{"text":"Just left @statuz home because he has more important things to do (saving teh world from evil ninjas) on my way to more trance and beer!","to_user_id":null,"from_user":"Trance_Cat","id":2404589416,"from_user_id":15859610,"iso_language_code":"en","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/141213693\/Begging_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:03 +0000"},{"text":"Free eats, free beer. rsvp@sashayevents.com","to_user_id":null,"from_user":"jonjon411","id":2404584310,"from_user_id":18690710,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/276301021\/green_2378_cut_hair_normal.jpg","created_at":"Tue, 30 Jun 2009 15:03:42 +0000"},{"text":"Today: pancakes, and LotR. Tomorrow: Canada's birthday, beer, and pie.","to_user_id":null,"from_user":"blackmesaeast","id":2404582296,"from_user_id":4210488,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/203669231\/ph008_ravenrouge__normal.png","created_at":"Tue, 30 Jun 2009 15:03:33 +0000"},{"text":"Small beer firm helps troubled teens - http:\/\/bit.ly\/5wVzL","to_user_id":null,"from_user":"InternetJunkee","id":2404582076,"from_user_id":24711327,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/134891444\/Me_1_normal.JPG","created_at":"Tue, 30 Jun 2009 15:03:32 +0000"},{"text":"ha dad going to ac dc . he owes me money too . he'll end up spending that on t-shirts or beer","to_user_id":null,"from_user":"Tulippee","id":2404581616,"from_user_id":17109021,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/275211879\/DSC05211_normal.JPG","created_at":"Tue, 30 Jun 2009 15:03:30 +0000"},{"text":"Listening to Sonic this morning, best quote ever: "What grows in the beer gardens? High risk, degrading sex with strangers."","to_user_id":null,"from_user":"redheadpixie","id":2404580561,"from_user_id":17271450,"iso_language_code":"en","source":"<a href="http:\/\/twitterfox.net\/">TwitterFox<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/213705977\/JM_0184sm2_normal.JPG","created_at":"Tue, 30 Jun 2009 15:03:26 +0000"},{"text":"New PC terminology. Instead of "Beer Belly," we're going to call it "Malt Beverage Midriff." Who's with me?","to_user_id":null,"from_user":"pottymouthcon","id":2404579509,"from_user_id":15895914,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/200753088\/toilet_normal.jpg","created_at":"Tue, 30 Jun 2009 15:03:21 +0000"},{"text":"bored, bored, bored, bored. I wanna go to Moe's and have a beer w\/ Homer. (and then go to neverland. L)","to_user_id":null,"from_user":"thewayofcontrol","id":2404579096,"from_user_id":10148206,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/285813999\/100_1632_6_ava_normal.jpg","created_at":"Tue, 30 Jun 2009 15:03:20 +0000"}],"since_id":0,"max_id":2404598347,"refresh_url":"?since_id=2404598347&q=beer+-root","results_per_page":15,"next_page":"?page=2&max_id=2404598347&q=beer+-root","completed_in":0.167684,"page":1,"query":"beer+-root"} \ No newline at end of file diff --git a/test/json/flight_negative_tude.json b/test/json/flight_negative_tude.json new file mode 100644 index 0000000..b954995 --- /dev/null +++ b/test/json/flight_negative_tude.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 17:14:20 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb001 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb001.twitter.com +Expires: Tue, 30 Jun 2009 17:19:20 GMT +Content-Length: 7475 +Vary: Accept-Encoding +X-Varnish: 1605495383 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb001.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"@alun i missed a flight (from heathrow) once because of them #eastmidlandstrains :(","to_user_id":235009,"to_user":"alun","from_user":"MXML","id":2406386625,"from_user_id":14608838,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/212804556\/2009_04_26_Twitter_politique_normal.jpg","created_at":"Tue, 30 Jun 2009 17:11:52 +0000"},{"text":"Just landed in la time to go bored another flight woohooo :(","to_user_id":null,"from_user":"bigmike12790","id":2406373112,"from_user_id":23334906,"iso_language_code":"en","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 17:10:53 +0000"},{"text":"making a list for my flight tomorrow :( im gonna miss illinois","to_user_id":null,"from_user":"alliecrivello","id":2406209149,"from_user_id":13364643,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/264926278\/get-attachment-2_normal.jpg","created_at":"Tue, 30 Jun 2009 16:59:27 +0000"},{"text":"@dijibeatnetwork I actualy have a bikini shoot scheduled in 3 weeks on the West coast.. but dont have my flight tix yet :( itchin 4 a shoot!","to_user_id":13455661,"to_user":"dijibeatnetwork","from_user":"promogurl","id":2406045858,"from_user_id":1534929,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/241412287\/coming_for_you_normal.jpg","created_at":"Tue, 30 Jun 2009 16:47:52 +0000"},{"text":"OMG I can't wait for the 4th of July!!! It's gonna be so much fun, but I'll be fuck tired cause my flight is at 5am :(","to_user_id":null,"from_user":"ChristianDefaux","id":2406009369,"from_user_id":23264287,"iso_language_code":"en","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/282590926\/green_0263_syaoran_normal.jpg","created_at":"Tue, 30 Jun 2009 16:45:22 +0000"},{"text":"3 hours left before the first flight... bye canada. :-(","to_user_id":null,"from_user":"pschoening","id":2405912848,"from_user_id":23314822,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/273770016\/007_normal.jpg","created_at":"Tue, 30 Jun 2009 16:38:22 +0000"},{"text":"Nope - they're not! Some airports are better than others to be stuck in tho. RT @TheMandyMoore: Flight delays are not fun. :(","to_user_id":null,"from_user":"JENw1n525","id":2405861483,"from_user_id":15420853,"iso_language_code":"en","source":"<a href="http:\/\/www.twittergadget.com">TwitterGadget<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/200572189\/me_dos_gringos_5-08_normal.JPG","created_at":"Tue, 30 Jun 2009 16:34:44 +0000"},{"text":"@Jezriyah Well, you can't refund your flight and hotel, and now it's too late to give the ticket to anyone else. So you're going :P","to_user_id":4805823,"to_user":"Jezriyah","from_user":"Ktok","id":2405552070,"from_user_id":814347,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/269364525\/ktok_red_normal.jpg","created_at":"Tue, 30 Jun 2009 16:12:58 +0000"},{"text":"Nite! Gotta wake up early tomorrow to catch the flight for me to go back to Jakarta again. I miss my room but I will also miss Singapore :(","to_user_id":null,"from_user":"keshia0909","id":2405477931,"from_user_id":21430015,"iso_language_code":"en","source":"<a href="http:\/\/orangatame.com\/products\/twitterberry\/">TwitterBerry<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288720191\/jalex_normal.png","created_at":"Tue, 30 Jun 2009 16:07:35 +0000"},{"text":"@sunshineinajar I watched like all the movies on my flight over the Atlantic lol. I was sad they didn't have Twilight :(","to_user_id":7355094,"to_user":"sunshineinajar","from_user":"lovethatlook","id":2405280731,"from_user_id":13358833,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/73828111\/n627456468_1275479_7454_normal.jpg","created_at":"Tue, 30 Jun 2009 15:53:43 +0000"},{"text":"Flight's at 5pm, medication is at 5:01pm :P","to_user_id":null,"from_user":"jokesongreg","id":2405263036,"from_user_id":8337070,"iso_language_code":"en","source":"<a href="http:\/\/orangatame.com\/products\/twitterberry\/">TwitterBerry<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 15:52:27 +0000"},{"text":"Fell asleep out of exhaustion and DH left for flight while I was asleep, said he didn't want to disturb me.. so sad. : (","to_user_id":null,"from_user":"CptCswife","id":2404907630,"from_user_id":6455771,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288168497\/angelina2_normal.gif","created_at":"Tue, 30 Jun 2009 15:27:01 +0000"},{"text":"Just found out from expedia that my flight back from Cologne has been changed. It's now 9am!!! Early start coming home then. Damn :(","to_user_id":null,"from_user":"Gari14WENB","id":2404887895,"from_user_id":15551217,"iso_language_code":"en","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/196734794\/Pic128_normal.jpg","created_at":"Tue, 30 Jun 2009 15:25:34 +0000"},{"text":"I agree! Especially when u hv 2 catch a connecting flite! I lived that nitemare 2 wks ago! RT @TheMandyMoore: Flight delays are not fun. :(","to_user_id":null,"from_user":"TheWildOne","id":2404859125,"from_user_id":8811835,"iso_language_code":"en","source":"<a href="http:\/\/help.twitter.com\/index.php?pg=kb.page&id=75">txt<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/135373204\/Kay.20090314.by_Danielle_Williamson.edit.001.crop_normal.jpg","created_at":"Tue, 30 Jun 2009 15:23:29 +0000"},{"text":"Flight delays are not fun. :( (via @TheMandyMoore) 2nd that! Aloha & safe travels!","to_user_id":null,"from_user":"Aceman808","id":2404848665,"from_user_id":2808797,"iso_language_code":"en","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/265678031\/Avatar_Green_normal.jpg","created_at":"Tue, 30 Jun 2009 15:22:43 +0000"}],"since_id":0,"max_id":2406386625,"refresh_url":"?since_id=2406386625&q=flight+%3A%28","results_per_page":15,"next_page":"?page=2&max_id=2406386625&q=flight+%3A%28","completed_in":0.039279,"page":1,"query":"flight+%3A%28"} \ No newline at end of file diff --git a/test/json/from_alexiskold.json b/test/json/from_alexiskold.json new file mode 100644 index 0000000..6d00cb2 --- /dev/null +++ b/test/json/from_alexiskold.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:07:15 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb027 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb027.twitter.com +Expires: Tue, 30 Jun 2009 15:12:15 GMT +Content-Length: 7055 +Vary: Accept-Encoding +X-Varnish: 818612119 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb027.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"Firefox 3.5 arrives today: http:\/\/bit.ly\/Gj5Xu","to_user_id":null,"from_user":"alexiskold","id":2404479055,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Tue, 30 Jun 2009 14:56:05 +0000"},{"text":"Just tried my first video on new IPhone. The awesomeness is hard to describe. How do I upload this to YouTube directly?","to_user_id":null,"from_user":"alexiskold","id":2402981419,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitterrific.com">Twitterrific<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Tue, 30 Jun 2009 12:51:44 +0000"},{"text":"Wow, this new iPhone is FAST folks and I mean FAST.","to_user_id":null,"from_user":"alexiskold","id":2402871662,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Tue, 30 Jun 2009 12:40:11 +0000"},{"text":"New iPhone activated! Wow, talk about simple upgrade, damn, Apple sets the bar too high.","to_user_id":null,"from_user":"alexiskold","id":2402808441,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Tue, 30 Jun 2009 12:33:23 +0000"},{"text":"RT @egoldstein Is your brain on the edge of chaos? via @spaceweaver http:\/\/bit.ly\/1nlQW. Me: Not usually. but today - yes.","to_user_id":null,"from_user":"alexiskold","id":2402788798,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Tue, 30 Jun 2009 12:31:21 +0000"},{"text":"Follow up question: How is real-time web different from news?","to_user_id":null,"from_user":"alexiskold","id":2402755472,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Tue, 30 Jun 2009 12:27:42 +0000"},{"text":"I am still trying to figure who cares about the real-time web. Any takers?","to_user_id":null,"from_user":"alexiskold","id":2399743317,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Tue, 30 Jun 2009 05:38:39 +0000"},{"text":"Gladwell review of Chris Anderson's book on Free. Its good, but super lengthy and font is terrible. http:\/\/bit.ly\/5wvDz","to_user_id":null,"from_user":"alexiskold","id":2395203803,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/www.getglue.com">Glue<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Mon, 29 Jun 2009 23:23:03 +0000"},{"text":"@neilr no win situation, because no vacation => tired all the time.","to_user_id":157506,"to_user":"neilr","from_user":"alexiskold","id":2394944081,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Mon, 29 Jun 2009 23:02:39 +0000"},{"text":"Mozilla team is getting excited about Firefox 3.5: http:\/\/bit.ly\/EKWD1 via @firefox","to_user_id":null,"from_user":"alexiskold","id":2394457246,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Mon, 29 Jun 2009 22:23:52 +0000"},{"text":"RT @nicluciano Check this out... http:\/\/bit.ly\/hm3pW","to_user_id":null,"from_user":"alexiskold","id":2391547943,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Mon, 29 Jun 2009 18:53:29 +0000"},{"text":"RT @SteffanAntonas @sarahintampa @rww: Why not manage online reputation on social services how eBay does? http:\/\/bit.ly\/Md3Wo","to_user_id":null,"from_user":"alexiskold","id":2389392464,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Mon, 29 Jun 2009 16:15:41 +0000"},{"text":"RT @jowyang Updated Social Network Stats http:\/\/bit.ly\/12cK1h Updated Twitter section: Average: 126 followers. Me: What about median?","to_user_id":null,"from_user":"alexiskold","id":2389381077,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Mon, 29 Jun 2009 16:14:55 +0000"},{"text":"@foursquare yes. I think it should be auto sync not import. Why do I need to manually approve each one on FourSquare?","to_user_id":4365423,"to_user":"Foursquare","from_user":"alexiskold","id":2388250135,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Mon, 29 Jun 2009 14:49:40 +0000"},{"text":"RT @akumar @lsmarshall: First rudimentary solid-state quantum processor created; could lead to quantum computer: http:\/\/tinyurl.com\/m83q6l","to_user_id":null,"from_user":"alexiskold","id":2388171478,"from_user_id":42740,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284591647\/Glue_126_normal.jpg","created_at":"Mon, 29 Jun 2009 14:43:19 +0000"}],"since_id":0,"max_id":2404479055,"refresh_url":"?since_id=2404479055&q=from%3Aalexiskold","results_per_page":15,"next_page":"?page=2&max_id=2404479055&q=from%3Aalexiskold","completed_in":0.035137,"page":1,"query":"from%3Aalexiskold"} \ No newline at end of file diff --git a/test/json/ftw_until.json b/test/json/ftw_until.json new file mode 100644 index 0000000..22c1c19 --- /dev/null +++ b/test/json/ftw_until.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:42:45 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb001 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb009.twitter.com +Expires: Tue, 30 Jun 2009 15:47:45 GMT +Content-Length: 7087 +Vary: Accept-Encoding +X-Varnish: 850382253 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb009.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"FTW-business sucks and they treat their people like shit","to_user_id":null,"from_user":"Horror_World","id":2405123593,"from_user_id":18829751,"iso_language_code":"en","source":"<a href="http:\/\/www.twittergadget.com">TwitterGadget<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/267897607\/green_8186_emmee_normal.jpg","created_at":"Tue, 30 Jun 2009 15:42:38 +0000"},{"text":"A sad day for torrent users, as The Pirate Bay has been sold. Hit me up if you need an invite to Demonoid. Private Trackers FTW.","to_user_id":null,"from_user":"cowboymustard","id":2405119192,"from_user_id":9852856,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/139252903\/Webster_normal.jpg","created_at":"Tue, 30 Jun 2009 15:42:18 +0000"},{"text":"@wimjimjam DEGRASSI FTW.","to_user_id":20789031,"to_user":"wimjimjam","from_user":"tylercuoco","id":2405115699,"from_user_id":22367637,"iso_language_code":"de","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284209916\/1_normal.bmp","created_at":"Tue, 30 Jun 2009 15:42:03 +0000"},{"text":"@laylakayleigh as mentioned, internet. But now that I think of it, an endless supply of Klondike bars would be FTW","to_user_id":2417344,"to_user":"laylakayleigh","from_user":"PlayBoyMan","id":2405115578,"from_user_id":5487341,"iso_language_code":"en","source":"<a href="http:\/\/help.twitter.com\/index.php?pg=kb.page&id=75">txt<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/276725542\/green_0453_pirate_bay_logo_250-100x100_normal.jpg","created_at":"Tue, 30 Jun 2009 15:42:02 +0000"},{"text":"@NickColley 4chan ftw","to_user_id":4753975,"to_user":"NickColley","from_user":"_Azzah","id":2405114355,"from_user_id":15177488,"iso_language_code":"de","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/269196430\/green_7403_SP_A1009_normal.jpg","created_at":"Tue, 30 Jun 2009 15:41:56 +0000"},{"text":"Ftw... Time to gamble...","to_user_id":null,"from_user":"ta2paradiseDC","id":2405111727,"from_user_id":9863828,"iso_language_code":"es","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/120306480\/twitterpic_normal.jpg","created_at":"Tue, 30 Jun 2009 15:41:45 +0000"},{"text":"Missed my flight... extra day in California FTW","to_user_id":null,"from_user":"buryingluck","id":2405110455,"from_user_id":7991969,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/279763604\/IMG_3469_normal.JPG","created_at":"Tue, 30 Jun 2009 15:41:39 +0000"},{"text":"Got back from an awesome weekend with in-laws in Abilene... Feeling rested and ready to get back to work! Dare to Dream FTW!!","to_user_id":null,"from_user":"pistol62","id":2405107663,"from_user_id":1123299,"iso_language_code":"en","source":"<a href="http:\/\/twitterrific.com">Twitterrific<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/224977378\/icon_normal.jpg","created_at":"Tue, 30 Jun 2009 15:41:27 +0000"},{"text":"Bought myself a new belt from Burton :) #ftw. Why do I feel like spending all the money I have in Burton? Laters crew =]","to_user_id":null,"from_user":"jamesh_1993","id":2405101917,"from_user_id":4301191,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/214560638\/jameshead_normal.jpg","created_at":"Tue, 30 Jun 2009 15:41:02 +0000"},{"text":"wow. I can *clearly* hear the jazz festival from here, and I can see the center stage. 26th floor home balcony seats ftw!","to_user_id":null,"from_user":"seanpower","id":2405099906,"from_user_id":498147,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/62454156\/Picture_6_normal.png","created_at":"Tue, 30 Jun 2009 15:40:53 +0000"},{"text":"@RufusHound Android ftw.","to_user_id":4432332,"to_user":"RufusHound","from_user":"samozzy","id":2405097765,"from_user_id":8390740,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/270767269\/green_4255_Avatar_normal.jpg","created_at":"Tue, 30 Jun 2009 15:40:43 +0000"},{"text":"Just been outside and given my garden wall a fresh paint of white. Now in to watch the tennis. Summer ftw!","to_user_id":null,"from_user":"adamoc","id":2405090746,"from_user_id":10486,"iso_language_code":"en","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/248061967\/me_normal.jpg","created_at":"Tue, 30 Jun 2009 15:40:12 +0000"},{"text":"First tweet, yipee. I'm going to miss Michael Jackson but I think I'll miss Billy Mays even more. XD btw, Federer ftw.","to_user_id":null,"from_user":"eric057","id":2405090051,"from_user_id":21813326,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 15:40:09 +0000"},{"text":"@heavenztrash multitasking ftw.","to_user_id":4575199,"to_user":"heavenztrash","from_user":"morkuma","id":2405087034,"from_user_id":11443267,"iso_language_code":"no","source":"<a href="http:\/\/help.twitter.com\/index.php?pg=kb.page&id=75">txt<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/281757820\/puppet01_normal.gif","created_at":"Tue, 30 Jun 2009 15:39:57 +0000"},{"text":"(RT @fizzlemed) "Dear Macy's: way to put a reflective floor in the bathroom, you morons." Corpthink FTW!","to_user_id":null,"from_user":"brianbreed","id":2405073288,"from_user_id":4567430,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/149933352\/Photo_118_normal.jpg","created_at":"Tue, 30 Jun 2009 15:38:56 +0000"}],"since_id":0,"max_id":2405123593,"refresh_url":"?since_id=2405123593&q=ftw+until%3A2009-06-30","results_per_page":15,"next_page":"?page=2&max_id=2405123593&q=ftw+until%3A2009-06-30","completed_in":0.038198,"page":1,"query":"ftw+until%3A2009-06-30"} \ No newline at end of file diff --git a/test/json/happy_hour_exact.json b/test/json/happy_hour_exact.json new file mode 100644 index 0000000..5bfcfc8 --- /dev/null +++ b/test/json/happy_hour_exact.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 14:59:00 GMT +Server: hi +Status: 200 OK +X-Served-From: b005 +X-Timeline-Cache-Hit: Hit +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: c005.twitter.com +Expires: Tue, 30 Jun 2009 15:04:00 GMT +Content-Length: 7436 +Vary: Accept-Encoding +X-Varnish: 1415363084 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: c005.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"It's Happy Hour Wednesday night at The Armory Tavern! You have to come for one of Duane's famous Margaritas or an ice cold beer! 5:30","to_user_id":null,"from_user":"fionababy","id":2404465054,"from_user_id":16014120,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/250397837\/_fiona_normal.jpg","created_at":"Tue, 30 Jun 2009 14:55:03 +0000"},{"text":"Happy Hour - Monday Thru Friday 5pm Until 8pm.\nThursday Night: FREE POOL From 5pm Until Midnight. 4 more dtails call 614.847.5787","to_user_id":null,"from_user":"studioclub161","id":2404432108,"from_user_id":20147573,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/264222382\/181_061309_normal.jpg","created_at":"Tue, 30 Jun 2009 14:52:34 +0000"},{"text":"Happy Hour: The great debate (Yahoo! Sports): Readers debate the validity of Joey Loganos rain-shortened win at .. http:\/\/tinyurl.com\/mloo7c","to_user_id":null,"from_user":"sportsdailyfix","id":2404424374,"from_user_id":3418113,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69937878\/twittersdf_normal.jpg","created_at":"Tue, 30 Jun 2009 14:52:01 +0000"},{"text":"77002- Cabo's is hosting July 3rd, Comedy Happy Hour! 419 Travis, 5-8PM. Comedy, free FOOD, Drink Specials, Happy People - $10 admission.","to_user_id":null,"from_user":"UrbanosNews","id":2404382474,"from_user_id":22207183,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284848412\/0906_URBANOSnews_Logo_normal.png","created_at":"Tue, 30 Jun 2009 14:48:57 +0000"},{"text":"77002- Cabo's is hosting July 3rd, Comedy Happy Hour! 419 Travis, 5-8PM. Comedy, free FOOD, Drink Specials, Happy People - $10 admission.","to_user_id":null,"from_user":"77002Events","id":2404382408,"from_user_id":23150243,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/284839828\/0906_77002Events_Logo_normal.png","created_at":"Tue, 30 Jun 2009 14:48:56 +0000"},{"text":"Remember: WORK is only the unpleasant hours before happy hour. (AC)","to_user_id":null,"from_user":"Lighting_in_AZ","id":2404358963,"from_user_id":17732622,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/211627758\/m_49a551897f10d8e4c14df7d6a5d30dcb_1__normal.jpg","created_at":"Tue, 30 Jun 2009 14:47:14 +0000"},{"text":"@tealkra 10 or 11. They are setting it up now. Happy hour is @ 12.","to_user_id":225442,"to_user":"tealkra","from_user":"MrsDirtyMartini","id":2404348627,"from_user_id":14484323,"iso_language_code":"en","source":"<a href="http:\/\/ubertwitter.com">UberTwitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/283605979\/3066_93918589166_669469166_2411784_2140141_n_1__normal.jpg","created_at":"Tue, 30 Jun 2009 14:46:29 +0000"},{"text":"@mymoodismusic what time is the happy hour again?","to_user_id":2550348,"to_user":"mymoodismusic","from_user":"hollyhood","id":2404307428,"from_user_id":934302,"iso_language_code":"en","source":"<a href="http:\/\/ubertwitter.com">UberTwitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/273372325\/n8901414_30878966_7557_normal.jpg","created_at":"Tue, 30 Jun 2009 14:43:24 +0000"},{"text":"New blog post: Happy Hour: The great debate (Yahoo! Sports) http:\/\/bit.ly\/R33ky","to_user_id":null,"from_user":"sportsdailyfix","id":2404301557,"from_user_id":3418113,"iso_language_code":"en","source":"<a href="http:\/\/alexking.org\/projects\/wordpress">Twitter Tools<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69937878\/twittersdf_normal.jpg","created_at":"Tue, 30 Jun 2009 14:42:56 +0000"},{"text":"I just got invited to happy hour.......too bad i'm not 21 ;(","to_user_id":null,"from_user":"sandrasuarez","id":2404300010,"from_user_id":5503715,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/263848367\/Senior_Year_scrap_book_013_normal.jpg","created_at":"Tue, 30 Jun 2009 14:42:49 +0000"},{"text":"Good morning! We're excited about our Happy Hour at Sambuca Uptown!","to_user_id":null,"from_user":"PPNorthTexas","id":2404293916,"from_user_id":4040323,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/247051894\/2248885-725831_normal.jpg","created_at":"Tue, 30 Jun 2009 14:42:21 +0000"},{"text":"@MMeltonUT hiii don't know what you are doing, but we are ready for happy hour whenever!!","to_user_id":5054641,"to_user":"MMeltonUT","from_user":"ahhyatt","id":2404291858,"from_user_id":5055182,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/79731770\/sophmore_score_031new_normal.jpg","created_at":"Tue, 30 Jun 2009 14:42:11 +0000"},{"text":"Come join us for great food and ambiance at Cyclone Anaya's. Our lunch specials are $8 & $9 and we have great Happy Hour specials!","to_user_id":null,"from_user":"CycloneAnayas","id":2404288807,"from_user_id":7911800,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/129057894\/Ceviche_Nachos-Small_normal.jpg","created_at":"Tue, 30 Jun 2009 14:41:57 +0000"},{"text":"Getting ready for work. Happy hour at Andina tonight! DELICIOUS","to_user_id":null,"from_user":"torgersj","id":2404284010,"from_user_id":18247232,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/224233651\/fez_normal.gif","created_at":"Tue, 30 Jun 2009 14:41:35 +0000"},{"text":"Melhor que um happy hour, hj deve ser uma festa de despedida, sem o despedio...Tendencia da qualidade de vida de 0 a 1000","to_user_id":null,"from_user":"TNhoque","id":2404281613,"from_user_id":20394037,"iso_language_code":"pt","source":"<a href="http:\/\/www.twittergadget.com">TwitterGadget<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/251237290\/Eu_normal.jpg","created_at":"Tue, 30 Jun 2009 14:41:23 +0000"}],"since_id":0,"max_id":2404465054,"refresh_url":"?since_id=2404465054&q=%22happy+hour%22","results_per_page":15,"next_page":"?page=2&max_id=2404465054&q=%22happy+hour%22","completed_in":0.018475,"page":1,"query":"%22happy+hour%22"} \ No newline at end of file diff --git a/test/json/hashtag_haiku.json b/test/json/hashtag_haiku.json new file mode 100644 index 0000000..164f155 --- /dev/null +++ b/test/json/hashtag_haiku.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:04:45 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb006 +X-Timeline-Cache-Hit: Hit +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb006.twitter.com +Expires: Tue, 30 Jun 2009 15:09:45 GMT +Content-Length: 7446 +Vary: Accept-Encoding +X-Varnish: 88821928 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb006.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"RT @FlorBorja u just made me cry \/ with the video that u \/ put missing the boyz :( #haiku","to_user_id":null,"from_user":"accidentalhaiku","id":2404518255,"from_user_id":2483471,"iso_language_code":"en","source":"<a href="http:\/\/search.cpan.org\/dist\/Net-Twitter\/">Perl Net::Twitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/203647309\/accidentalhaiku.pic_normal.jpg","created_at":"Tue, 30 Jun 2009 14:59:04 +0000"},{"text":"Living in a garbage house?\/Managed healt care cannot help you\/My work here is done #haiku","to_user_id":null,"from_user":"uppoppedafox","id":2404500250,"from_user_id":4048371,"iso_language_code":"en","source":"<a href="http:\/\/twitterhelp.blogspot.com\/2008\/05\/twitter-via-mobile-web-mtwittercom.html">mobile web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/85244624\/2_normal.jpg","created_at":"Tue, 30 Jun 2009 14:57:42 +0000"},{"text":"Oh managed health care\/how you confound and bore me\/we are worlds apart #haiku","to_user_id":null,"from_user":"uppoppedafox","id":2404476847,"from_user_id":4048371,"iso_language_code":"en","source":"<a href="http:\/\/twitterhelp.blogspot.com\/2008\/05\/twitter-via-mobile-web-mtwittercom.html">mobile web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/85244624\/2_normal.jpg","created_at":"Tue, 30 Jun 2009 14:55:55 +0000"},{"text":"Proofread these words then \/ Miss - stay can eye den titty \/ ID comedy \/\/\/ #haiku #haikuchallenge #mistake","to_user_id":null,"from_user":"Christwitery","id":2404457114,"from_user_id":4104024,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/278005083\/green_3406_EYEg_normal.JPG","created_at":"Tue, 30 Jun 2009 14:54:28 +0000"},{"text":"#pdf09 #haiku Transparency Corps \/ noodge netizens united \/ earmarks on alert","to_user_id":null,"from_user":"Mcktymuck","id":2404443680,"from_user_id":20374734,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 14:53:27 +0000"},{"text":"RT @BonnieYoakum see on the liquid \/ diet you can have all the \/ alcohol you want.... #haiku","to_user_id":null,"from_user":"accidentalhaiku","id":2404438344,"from_user_id":2483471,"iso_language_code":"en","source":"<a href="http:\/\/search.cpan.org\/dist\/Net-Twitter\/">Perl Net::Twitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/203647309\/accidentalhaiku.pic_normal.jpg","created_at":"Tue, 30 Jun 2009 14:53:03 +0000"},{"text":"Last tweet before sleep. Moon sinkin' in distant mist. Rollin' off the edge. #haiku","to_user_id":null,"from_user":"sylmobile","id":2404423477,"from_user_id":1359337,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/217698665\/Sylvano_Head_normal.jpg","created_at":"Tue, 30 Jun 2009 14:51:57 +0000"},{"text":"RT @behatted it's okay. pays the \/ bills while i make my silly \/ comics about hats. #haiku","to_user_id":null,"from_user":"accidentalhaiku","id":2404328601,"from_user_id":2483471,"iso_language_code":"en","source":"<a href="http:\/\/search.cpan.org\/dist\/Net-Twitter\/">Perl Net::Twitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/203647309\/accidentalhaiku.pic_normal.jpg","created_at":"Tue, 30 Jun 2009 14:45:03 +0000"},{"text":"(ha ha!) RT @accidentalhaiku RT @evdayspa great! might have a few \/ additions still, will call you \/ later if we do. #haiku","to_user_id":null,"from_user":"evdayspa","id":2404298925,"from_user_id":9602665,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/117989051\/cassie_photo_normal.jpg","created_at":"Tue, 30 Jun 2009 14:42:44 +0000"},{"text":"RT @mourningbell cat naps really \/ do the trick. and now back to \/ being bored at work. #haiku","to_user_id":null,"from_user":"accidentalhaiku","id":2404277194,"from_user_id":2483471,"iso_language_code":"en","source":"<a href="http:\/\/search.cpan.org\/dist\/Net-Twitter\/">Perl Net::Twitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/203647309\/accidentalhaiku.pic_normal.jpg","created_at":"Tue, 30 Jun 2009 14:41:03 +0000"},{"text":"Wanna follow me \/ and send me spam all day long \/ that was a mistake \/\/\/ #haiku #haikuchallenge #mistake","to_user_id":null,"from_user":"Christwitery","id":2404220525,"from_user_id":4104024,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/278005083\/green_3406_EYEg_normal.JPG","created_at":"Tue, 30 Jun 2009 14:36:39 +0000"},{"text":"#pdf09 #haiku one Vivek Kundra \/ surveys the data tundra \/ says let it all bloom","to_user_id":null,"from_user":"Mcktymuck","id":2404199426,"from_user_id":20374734,"iso_language_code":"no","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 14:35:04 +0000"},{"text":"RT @neondeception i try to be nice, \/ but i don't like people so \/ its hard for me. lol #haiku","to_user_id":null,"from_user":"accidentalhaiku","id":2404187486,"from_user_id":2483471,"iso_language_code":"en","source":"<a href="http:\/\/search.cpan.org\/dist\/Net-Twitter\/">Perl Net::Twitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/203647309\/accidentalhaiku.pic_normal.jpg","created_at":"Tue, 30 Jun 2009 14:34:09 +0000"},{"text":"RT @sophielo rain rain go away \/ please make sure you're gone away \/ for my holiday. #haiku","to_user_id":null,"from_user":"accidentalhaiku","id":2404187334,"from_user_id":2483471,"iso_language_code":"en","source":"<a href="http:\/\/search.cpan.org\/dist\/Net-Twitter\/">Perl Net::Twitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/203647309\/accidentalhaiku.pic_normal.jpg","created_at":"Tue, 30 Jun 2009 14:34:08 +0000"},{"text":"Corpse pierced by pick \/ far too gruesome to behold \/ mistaken for vampire \/\/\/ #haiku #haikuchallenge #mistake","to_user_id":null,"from_user":"Christwitery","id":2404179179,"from_user_id":4104024,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/278005083\/green_3406_EYEg_normal.JPG","created_at":"Tue, 30 Jun 2009 14:33:31 +0000"}],"since_id":0,"max_id":2404518255,"refresh_url":"?since_id=2404518255&q=%23haiku","results_per_page":15,"next_page":"?page=2&max_id=2404518255&q=%23haiku","completed_in":0.044571,"page":1,"query":"%23haiku"} \ No newline at end of file diff --git a/test/json/hilarious_links.json b/test/json/hilarious_links.json new file mode 100644 index 0000000..361ea8e --- /dev/null +++ b/test/json/hilarious_links.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:51:08 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb019 +X-Timeline-Cache-Hit: Hit +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb019.twitter.com +Expires: Tue, 30 Jun 2009 15:56:08 GMT +Content-Length: 7451 +Vary: Accept-Encoding +X-Varnish: 1300925403 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb019.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"RT @aplusk: I can't wait to see the movie Bravo collegehumor Bravo! http:\/\/bit.ly\/18jZ9j - This video is an epic win. absolutely hilarious","to_user_id":null,"from_user":"mksmith2","id":2405241711,"from_user_id":434210,"iso_language_code":"en","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/268267032\/green_1660_newav_normal.jpg","created_at":"Tue, 30 Jun 2009 15:50:57 +0000"},{"text":"HILARIOUS! RT @aplusk nothing like punking someone with ninja like skill http:\/\/bit.ly\/Efylf","to_user_id":null,"from_user":"zmoser","id":2405232288,"from_user_id":1636075,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/62104888\/Profile_Pic_normal.png","created_at":"Tue, 30 Jun 2009 15:50:17 +0000"},{"text":"RT @metalia: The picture's blurry (cameras forbidden). It is my hope that you can see THE HILARIOUS ITEM: http:\/\/yfrog.com\/5g615nj","to_user_id":null,"from_user":"hmarie99","id":2405223073,"from_user_id":3735261,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/249151064\/353_normal.JPG","created_at":"Tue, 30 Jun 2009 15:49:39 +0000"},{"text":"Aggregation of hilarious viral videos that spoof the advertising industry http:\/\/bit.ly\/h3AKm","to_user_id":null,"from_user":"LaurelNan","id":2405220336,"from_user_id":6212071,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/91907067\/laurel_normal.jpg","created_at":"Tue, 30 Jun 2009 15:49:27 +0000"},{"text":"oh i wish you all could understand this video http:\/\/bit.ly\/v5tWH It's hilarious =) =) http:\/\/tinyurl.com\/n8fqdp","to_user_id":null,"from_user":"TakeAWish","id":2405212745,"from_user_id":10317019,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/126193155\/crybaby_normal.jpg","created_at":"Tue, 30 Jun 2009 15:48:55 +0000"},{"text":"oh i wish you all could understand this video http:\/\/bit.ly\/v5tWH\n It's hilarious =) =)","to_user_id":null,"from_user":"SofiaMaximo","id":2405210452,"from_user_id":23723787,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288898623\/Sofia2_normal.JPG","created_at":"Tue, 30 Jun 2009 15:48:45 +0000"},{"text":"http:\/\/bit.ly\/2YcSHt\n\nthis is hilarious!!!!!","to_user_id":null,"from_user":"LaurenCoconut","id":2405201439,"from_user_id":12556279,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288653360\/huyk809_normal.png","created_at":"Tue, 30 Jun 2009 15:48:06 +0000"},{"text":"RT @johnremy: @shunn reads from his hilarious\/poignant autobio of Mormon missionary love, coming of age, & terrorism http:\/\/tr.im\/beatit","to_user_id":null,"from_user":"shunn","id":2405198239,"from_user_id":198441,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/279235097\/puckfair-lg_normal.jpg","created_at":"Tue, 30 Jun 2009 15:47:52 +0000"},{"text":"DAMMIT! RT Zach Galifianakis. I bet he hates it when you misspell his name. http:\/\/tinyurl.com\/py2kk8 Hilarious etc...","to_user_id":null,"from_user":"conery42","id":2405191369,"from_user_id":13702147,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/271516948\/DSC03495_normal.JPG","created_at":"Tue, 30 Jun 2009 15:47:23 +0000"},{"text":"Hilarious outing of dishonest indie bands by Hypemachine: http:\/\/bit.ly\/17sUGg. All their names are terrible, which makes it even better.","to_user_id":null,"from_user":"KTLincoln","id":2405186975,"from_user_id":5023266,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/78726336\/twitter_normal.jpg","created_at":"Tue, 30 Jun 2009 15:47:05 +0000"},{"text":"Uh oh -- is this what I'm in for with a new baby girl? http:\/\/www.snotr.com\/video\/2630 HILARIOUS!","to_user_id":null,"from_user":"drchrismohr","id":2405153075,"from_user_id":3470488,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/125746718\/Chris_Mohr_084_cropped_normal.jpg","created_at":"Tue, 30 Jun 2009 15:44:48 +0000"},{"text":"found another hilarious video http:\/\/bit.ly\/19THbA","to_user_id":null,"from_user":"NadaJBanfiel","id":2405143777,"from_user_id":25042493,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/286638551\/1709_normal.jpg","created_at":"Tue, 30 Jun 2009 15:44:07 +0000"},{"text":"RT @REALAberdeen: LOL, just found this old "rules for Aberdeen driving" online: http:\/\/u.nu\/5uwf v funny - Hilarious but rather true haha","to_user_id":null,"from_user":"tonightwedance","id":2405139067,"from_user_id":8858458,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/254760114\/Yashin_Moshulu_5.6.09_059_normal.JPG","created_at":"Tue, 30 Jun 2009 15:43:47 +0000"},{"text":"This is hilarious, have a look! http:\/\/bit.ly\/gM7QR","to_user_id":null,"from_user":"christinaroseb","id":2405133380,"from_user_id":17022878,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/214446692\/DSC00171_normal.JPG","created_at":"Tue, 30 Jun 2009 15:43:22 +0000"},{"text":"RT @Kawdess Hilarious: A tip sheet on how to successfully engage with Muslims online (via @mmwtweets) http:\/\/bit.ly\/DXF1X","to_user_id":null,"from_user":"telegantmess","id":2405120312,"from_user_id":12719952,"iso_language_code":"en","source":"<a href="http:\/\/twitterfox.net\/">TwitterFox<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/276503343\/6432_normal.jpg","created_at":"Tue, 30 Jun 2009 15:42:23 +0000"}],"since_id":2295493008,"max_id":2405241711,"refresh_url":"?since_id=2405241711&q=hilarious+filter%3Alinks","results_per_page":15,"next_page":"?page=2&max_id=2405241711&q=hilarious+filter%3Alinks","warning":"adjusted since_id, it was older than allowedsince_id removed for pagination.","completed_in":0.038344,"page":1,"query":"hilarious+filter%3Alinks"} \ No newline at end of file diff --git a/test/json/movie_positive_tude.json b/test/json/movie_positive_tude.json new file mode 100644 index 0000000..15341e9 --- /dev/null +++ b/test/json/movie_positive_tude.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:45:19 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb016 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb016.twitter.com +Expires: Tue, 30 Jun 2009 15:50:19 GMT +Content-Length: 7521 +Vary: Accept-Encoding +X-Varnish: 709226784 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb016.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"This day shall be good. Lunch with Brett, work with Julie, dinner and movie with Simon, off-call rehearsal with everybody. :)","to_user_id":null,"from_user":"Musicalandy","id":2405138310,"from_user_id":7340082,"iso_language_code":"en","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/99447909\/n549877570_5948_normal.jpg","created_at":"Tue, 30 Jun 2009 15:43:43 +0000"},{"text":"Rainy morning, exercise at the gym, rooibos tea, tortilla wrap, and Snatch the movie. Good morning so far :)","to_user_id":null,"from_user":"marieharang","id":2405138213,"from_user_id":107843,"iso_language_code":"en","source":"<a href="http:\/\/twitterrific.com">Twitterrific<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/51890034\/IMG_0071_normal.jpg","created_at":"Tue, 30 Jun 2009 15:43:43 +0000"},{"text":"@Phee78 Yes, for sure. I saw that movie when I was 7 or 8 and it was intriguing, but it freaked me out. should see it again as an adult. :)","to_user_id":5740764,"to_user":"Phee78","from_user":"nessa188","id":2405137922,"from_user_id":10995482,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/268422128\/Avatar_normal.JPG","created_at":"Tue, 30 Jun 2009 15:43:42 +0000"},{"text":"@happylovesChuck I think Princess Bride is the movie for the family! :)","to_user_id":15986882,"to_user":"happylovesChuck","from_user":"GodFirst08","id":2405135596,"from_user_id":7989141,"iso_language_code":"en","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/265428385\/ChuckA_normal.jpg","created_at":"Tue, 30 Jun 2009 15:43:32 +0000"},{"text":"Movie and pizza day with the girls. :)","to_user_id":null,"from_user":"emilyroseschuch","id":2405129947,"from_user_id":10287235,"iso_language_code":"en","source":"<a href="http:\/\/help.twitter.com\/index.php?pg=kb.page&id=75">txt<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/127494116\/l_6aa925ff656f4711bfad8855688fb31a_normal.jpg","created_at":"Tue, 30 Jun 2009 15:43:06 +0000"},{"text":"@eleonorajetzlaf haha :) we can watch this movie if u want :D xoxo","to_user_id":21629443,"to_user":"eleonorajetzlaf","from_user":"__denis","id":2405126216,"from_user_id":21785254,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/261527504\/DSC00819_normal.JPG","created_at":"Tue, 30 Jun 2009 15:42:50 +0000"},{"text":"I'm watching my fav movie now, RV! :D","to_user_id":null,"from_user":"tikitik","id":2405098454,"from_user_id":6173783,"iso_language_code":"en","source":"<a href="http:\/\/twittai.com\/">twittai<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/278158484\/petso_normal.jpg","created_at":"Tue, 30 Jun 2009 15:40:46 +0000"},{"text":"@JKsTenderLove ....hubby goes, Your boyfriend was in the movie. Glad to know that hubby knows I got a boyfriend on the side :-)","to_user_id":24191772,"to_user":"JKsTenderLove","from_user":"DDubsMyGuy","id":2405072681,"from_user_id":23701308,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288661367\/DDub_normal.jpg","created_at":"Tue, 30 Jun 2009 15:38:53 +0000"},{"text":"Quote from Hawks movie "Well that's what we came here for, looking for funny! I'm sorry, I've tried the alternative but i don't like it" :)","to_user_id":null,"from_user":"picto83","id":2405068904,"from_user_id":5648699,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288320189\/Photo_2_normal.jpg","created_at":"Tue, 30 Jun 2009 15:38:36 +0000"},{"text":"@Azza87 I wish I saw Bolt in 3D too I <3ed that movie HEAPS. yay its out 2day :-) lol I <3ed MvsA !!!","to_user_id":4429636,"to_user":"Azza87","from_user":"allyroar","id":2405068635,"from_user_id":4309211,"iso_language_code":"en","source":"<a href="http:\/\/twitterhelp.blogspot.com\/2008\/05\/twitter-via-mobile-web-mtwittercom.html">mobile web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/234055412\/n509658125_1033_normal.jpg","created_at":"Tue, 30 Jun 2009 15:38:35 +0000"},{"text":"@catholic_lib: Enjoy the movie, my dear friend. :-)","to_user_id":1819305,"to_user":"catholic_lib","from_user":"prosario_2000","id":2405057332,"from_user_id":2606028,"iso_language_code":"en","source":"<a href="https:\/\/launchpad.net\/gwibber\/">Gwibber<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/278382598\/green_7995_my_pic_green_small_normal.jpg","created_at":"Tue, 30 Jun 2009 15:37:45 +0000"},{"text":"@narain Thalaivar rocks in that video esp as Nageswara Rao. Watched the Telugu version of the movie just for these 3 precious scenes :)","to_user_id":50944,"to_user":"narain","from_user":"filby","id":2405045511,"from_user_id":742728,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/66908967\/FilbertRd_normal.jpg","created_at":"Tue, 30 Jun 2009 15:36:53 +0000"},{"text":"@Turtle502 The 'real' one, or the George Carlin version from the MTV Movie Awards? ;) :)","to_user_id":5311211,"to_user":"Turtle502","from_user":"NorrathReaver","id":2405021079,"from_user_id":5991606,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/289536578\/PoF1_normal.jpg","created_at":"Tue, 30 Jun 2009 15:35:09 +0000"},{"text":"going to get the jb 3d movie :)","to_user_id":null,"from_user":"kaseydiaa","id":2405019590,"from_user_id":6246895,"iso_language_code":"en","source":"<a href="http:\/\/twitterhelp.blogspot.com\/2008\/05\/twitter-via-mobile-web-mtwittercom.html">mobile web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/257480592\/Photo_933_normal.jpg","created_at":"Tue, 30 Jun 2009 15:35:03 +0000"},{"text":"@Gieeeyy hahaha, ntr hanah montana ada the movie nya lho ;) 7 things :D","to_user_id":19671731,"to_user":"Gieeeyy","from_user":"sashine","id":2405019092,"from_user_id":16414785,"iso_language_code":"en","source":"<a href="http:\/\/orangatame.com\/products\/twitterberry\/">TwitterBerry<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/68185692\/cha_tha_fel_kka_ter___normal.jpg","created_at":"Tue, 30 Jun 2009 15:35:01 +0000"}],"since_id":0,"max_id":2405138310,"refresh_url":"?since_id=2405138310&q=movie+-scary+%3A%29","results_per_page":15,"next_page":"?page=2&max_id=2405138310&q=movie+-scary+%3A%29","completed_in":0.029255,"page":1,"query":"movie+-scary+%3A%29"} \ No newline at end of file diff --git a/test/json/obama_or_hillary.json b/test/json/obama_or_hillary.json new file mode 100644 index 0000000..12b4bdf --- /dev/null +++ b/test/json/obama_or_hillary.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 17:10:50 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb008 +X-Timeline-Cache-Hit: Hit +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb008.twitter.com +Expires: Tue, 30 Jun 2009 17:15:50 GMT +Content-Length: 7524 +Vary: Accept-Encoding +X-Varnish: 1565820768 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb008.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"RT @mashable Obama Press Conference Interrupted by Duck Ringtone [Video] http:\/\/bit.ly\/3Ya5q (via @tweetmeme)","to_user_id":null,"from_user":"LoriOnTwittter","id":2406356940,"from_user_id":15761974,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/246609784\/Lori_tiny_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:45 +0000"},{"text":"Just saw a girl making a sharp left turn while adjusting her sunglasses with both hands. I'm sure there's an Obama reference there somewhere","to_user_id":null,"from_user":"deppisch","id":2406356886,"from_user_id":809599,"iso_language_code":"en","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/202876596\/n678852815_2112873_5106365_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:45 +0000"},{"text":"Obama Press Conference Interrupted by MY Ringtone [Video] http:\/\/bit.ly\/3Ya5q (via @adamostrow)","to_user_id":null,"from_user":"EvanD22","id":2406356718,"from_user_id":1833821,"iso_language_code":"en","source":"<a href="http:\/\/83degrees.com\/to\/powertwitter">Power Twitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/87367750\/Picture_5_normal.png","created_at":"Tue, 30 Jun 2009 17:09:44 +0000"},{"text":"Obama Press Conference? Should be interesting. I will be watching - Probably tweeting as well.","to_user_id":null,"from_user":"elonjames","id":2406355310,"from_user_id":155500,"iso_language_code":"en","source":"<a href="http:\/\/www.twhirl.org\/">twhirl<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/276778266\/n503653813_8481_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:38 +0000"},{"text":"RT @adamostrow Obama Press Conference Interrupted by Duck Ringtone [Video] - http:\/\/bit.ly\/Mng6g . worst ... cell phone ...etiquette ...ever","to_user_id":null,"from_user":"erickd","id":2406354481,"from_user_id":59108,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/49777022\/n24414147_31191711_3421_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:34 +0000"},{"text":"@chhintz Really? Have you looked at the numbers? 2007, US debt 65.5% of GDP. Obama's 2009 & 2010 budget 82.5% and 97% respectfully.","to_user_id":10585285,"to_user":"chhintz","from_user":"WillFuhrman","id":2406354118,"from_user_id":8344717,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/287999889\/will-iran_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:32 +0000"},{"text":"president obama to talk about social innovation live in 20 mins http:\/\/www.whitehouse.gov\/live\/","to_user_id":null,"from_user":"chadboettcher","id":2406354037,"from_user_id":1385492,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/136845946\/FB_bio_pic_normal.png","created_at":"Tue, 30 Jun 2009 17:09:32 +0000"},{"text":"Conservatives are so desperate these days. Now they writing about Obama's side eye action. SMH http:\/\/bit.ly\/2n16H","to_user_id":null,"from_user":"marikai","id":2406353430,"from_user_id":5387277,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/271502033\/taaz_makeover_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:29 +0000"},{"text":"RT @dudeman718: RT Obama Press Conference Interrupted by Duck Ringtone [Video] - http:\/\/bit.ly\/Mng6g (via @mashable)","to_user_id":null,"from_user":"diegoev","id":2406353417,"from_user_id":319509,"iso_language_code":"en","source":"<a href="http:\/\/destroytwitter.com\/">DestroyTwitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/132724143\/DSC00208_normal.JPG","created_at":"Tue, 30 Jun 2009 17:09:29 +0000"},{"text":"RT @mashable: Obama Press Conference Interrupted by Duck Ringtone [Video] - http:\/\/bit.ly\/Mng6g","to_user_id":null,"from_user":"rklau","id":2406351890,"from_user_id":24261,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/267857637\/green_6765_rpk-headshot_bigger_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:22 +0000"},{"text":"Obama Press Conference Interrupted by Duck Ringtone [Video] - http:\/\/bit.ly\/Mng6g (via @mashable)","to_user_id":null,"from_user":"deakaz","id":2406351289,"from_user_id":1555866,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/59724612\/deaka_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:20 +0000"},{"text":"RT @AllianceAlert * Obama hopes to persuade all Americans to accept homosexuality http:\/\/bit.ly\/uQAPD #fb","to_user_id":null,"from_user":"jeremydys","id":2406351179,"from_user_id":804089,"iso_language_code":"en","source":"<a href="http:\/\/twitterrific.com">Twitterrific<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/91022439\/MyPicture_-_bw_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:19 +0000"},{"text":"@aprilhill1 Donald Trump, supported Obama financially, and look what he got in return: A BIG SPENDER ... WITHOUT A 'BANK ACCOUNT'.","to_user_id":11392639,"to_user":"aprilhill1","from_user":"ROCKWITHBECK","id":2406351098,"from_user_id":15804479,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/273556862\/012_normal.JPG","created_at":"Tue, 30 Jun 2009 17:09:19 +0000"},{"text":"RT @mashable Obama Press Conference Interrupted by Duck Ringtone [Video] - http:\/\/bit.ly\/Mng6g","to_user_id":null,"from_user":"MummaBear","id":2406350793,"from_user_id":344219,"iso_language_code":"en","source":"<a href="http:\/\/twitter.peoplebrowsr.com\/dev">PeopleBrowsr<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/224385379\/04042009006-003_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:17 +0000"},{"text":"Obama & Dictators: Birds of a Feather (IBD editorial cartoon)... #tcot http:\/\/yfrog.com\/eqhglj","to_user_id":null,"from_user":"REDHK","id":2406350116,"from_user_id":12677666,"iso_language_code":"en","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/279682943\/tw_normal.jpg","created_at":"Tue, 30 Jun 2009 17:09:14 +0000"}],"since_id":0,"max_id":2406356940,"refresh_url":"?since_id=2406356940&q=obama+OR+hillary","results_per_page":15,"next_page":"?page=2&max_id=2406356940&q=obama+OR+hillary","completed_in":0.292195,"page":1,"query":"obama+OR+hillary"} \ No newline at end of file diff --git a/test/json/only_one_result.json b/test/json/only_one_result.json new file mode 100644 index 0000000..881fcbc --- /dev/null +++ b/test/json/only_one_result.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 17:44:22 GMT +Server: hi +Status: 200 OK +X-Served-From: b004 +X-Timeline-Cache-Hit: Hit +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: c004.twitter.com +Expires: Tue, 30 Jun 2009 17:49:22 GMT +Content-Length: 737 +Vary: Accept-Encoding +X-Varnish: 409233117 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: c004.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"@racheldonovan beginning class is in-depth ruby & TDD of the major features of rails. it's for developers new to ruby or testing.","to_user_id":2316235,"to_user":"racheldonovan","from_user":"thoughtbot","id":2406264287,"from_user_id":358670,"iso_language_code":"en","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/51656809\/radio_normal.png","created_at":"Tue, 30 Jun 2009 17:03:11 +0000"}],"since_id":0,"max_id":2406264287,"refresh_url":"?since_id=2406264287&q=beginning+class+is+in-depth+ruby","results_per_page":2,"completed_in":0.018828,"page":1,"query":"beginning+class+is+in-depth+ruby"} \ No newline at end of file diff --git a/test/json/page_one.json b/test/json/page_one.json new file mode 100644 index 0000000..5606958 --- /dev/null +++ b/test/json/page_one.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 18:17:39 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb016 +X-Timeline-Cache-Hit: Hit +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb016.twitter.com +Expires: Tue, 30 Jun 2009 18:22:39 GMT +Content-Length: 755 +Vary: Accept-Encoding +X-Varnish: 710226785 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb016.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"@teflonted I can get a machine running pretty quickly, this guide from #ThoughtBot is a good checklist as well: http:\/\/bit.ly\/eaSj2","to_user_id":67976,"to_user":"teflonted","from_user":"mwilliams","id":2407099995,"from_user_id":19051,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/112562238\/Picture_2_normal.png","created_at":"Tue, 30 Jun 2009 18:02:25 +0000"}],"since_id":0,"max_id":2407099995,"refresh_url":"?since_id=2407099995&q=thoughtbot","results_per_page":1,"next_page":"?page=2&max_id=2407099995&rpp=1&q=thoughtbot","completed_in":0.029054,"page":1,"query":"thoughtbot"} \ No newline at end of file diff --git a/test/json/page_two.json b/test/json/page_two.json new file mode 100644 index 0000000..bb27b4f --- /dev/null +++ b/test/json/page_two.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 18:17:52 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb017 +X-Timeline-Cache-Hit: Hit +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb017.twitter.com +Expires: Tue, 30 Jun 2009 18:22:52 GMT +Content-Length: 836 +Vary: Accept-Encoding +X-Varnish: 1554435378 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb017.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"@racheldonovan many beginning students also take the class to "fill in" holes in their rails knowledge they've picked up from books & blogs.","to_user_id":2316235,"to_user":"racheldonovan","from_user":"thoughtbot","id":2406285991,"from_user_id":358670,"iso_language_code":"en","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/51656809\/radio_normal.png","created_at":"Tue, 30 Jun 2009 17:04:41 +0000"}],"since_id":0,"max_id":2406285991,"previous_page":"?page=1&max_id=2406285991&rpp=1&q=thoughtbot","refresh_url":"?since_id=2406285991&q=thoughtbot","results_per_page":1,"next_page":"?page=3&max_id=2406285991&rpp=1&q=thoughtbot","completed_in":0.017051,"page":2,"query":"thoughtbot"} \ No newline at end of file diff --git a/test/json/reference_mashable.json b/test/json/reference_mashable.json new file mode 100644 index 0000000..43c2486 --- /dev/null +++ b/test/json/reference_mashable.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:10:40 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb004 +X-Timeline-Cache-Hit: Hit +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb004.twitter.com +Expires: Tue, 30 Jun 2009 15:15:39 GMT +Content-Length: 7442 +Vary: Accept-Encoding +X-Varnish: 131249223 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb004.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"RT @mashable Sneak Peek: What's On Tap for Firefox in 2010 http:\/\/cli.gs\/MYPAg (via @tweetmeme)","to_user_id":null,"from_user":"bassemeljisr","id":2404676705,"from_user_id":23362911,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/269881601\/n501698160_1430097_9219_normal.jpg","created_at":"Tue, 30 Jun 2009 15:10:21 +0000"},{"text":"katere seksi geekice slediti na twittru: http:\/\/bit.ly\/175j9M (via @mashable via @playboy)","to_user_id":null,"from_user":"gyzar","id":2404667867,"from_user_id":1023976,"iso_language_code":"eo","source":"<a href="http:\/\/twitterfox.net\/">TwitterFox<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/280760859\/avatar_tirka_normal.jpg","created_at":"Tue, 30 Jun 2009 15:09:44 +0000"},{"text":"RT @jordancda: 6 Gorgeous Twitter Visualizations - http:\/\/bit.ly\/prlZo (via @mashable) @joshmartinmusic @mattslote @drewworsham @glau6474","to_user_id":null,"from_user":"islandchic","id":2404665571,"from_user_id":1304849,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/274778442\/n511703644_69575_5623_normal.jpg","created_at":"Tue, 30 Jun 2009 15:09:33 +0000"},{"text":"Well, that was fun. RT @talatfakhri: RT: @mashable: BREAKING: The Pirate Bay Sold For $7.8 Million - http:\/\/bit.ly\/gCb9k","to_user_id":null,"from_user":"MixMaster","id":2404662516,"from_user_id":56306,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/18734632\/IMG_6474_normal.jpg","created_at":"Tue, 30 Jun 2009 15:09:19 +0000"},{"text":"Reading: When Does a Social Media Policy Go Too Far? Ask the AP http:\/\/is.gd\/1jcFD (via @mashable)","to_user_id":null,"from_user":"jhoysi","id":2404660368,"from_user_id":4026678,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/129316076\/Picture_8_normal.png","created_at":"Tue, 30 Jun 2009 15:09:10 +0000"},{"text":"6 Gorgeous Twitter Visualizations - http:\/\/bit.ly\/prlZo (via @mashable) @joshmartinmusic @mattslote @drewworsham @glau6474","to_user_id":null,"from_user":"jordancda","id":2404655537,"from_user_id":2652050,"iso_language_code":"en","source":"<a href="http:\/\/desktop.seesmic.com\/">Seesmic Desktop<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/265843862\/picture0001_normal.jpg","created_at":"Tue, 30 Jun 2009 15:08:48 +0000"},{"text":"RT @mashable Too Busy To Read Tweets? Try Twitter For Busy People http:\/\/bit.ly\/t9Abg (via @tweetmeme)","to_user_id":null,"from_user":"jbtomlin","id":2404648247,"from_user_id":10540807,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/128919610\/sexy-upside-down_normal.png","created_at":"Tue, 30 Jun 2009 15:08:16 +0000"},{"text":"RE: @mashable Anything short of continuing the current "business model" of Piracy will result in disaster - bad biz move\u2026 http:\/\/disq.us\/qn5","to_user_id":null,"from_user":"mikewayne","id":2404646845,"from_user_id":1315660,"iso_language_code":"en","source":"<a href="http:\/\/disqus.com\/">Disqus<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/65644912\/blogpic_normal.png","created_at":"Tue, 30 Jun 2009 15:08:10 +0000"},{"text":"RT @mashable HOW TO: Get More Involved in the Summer of Social Good http:\/\/tinyurl.com\/mggsem (via @tweetmeme)","to_user_id":null,"from_user":"kmlaughl","id":2404645577,"from_user_id":1112947,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/289239876\/blogger_photo_normal.jpg","created_at":"Tue, 30 Jun 2009 15:08:05 +0000"},{"text":"RT @heyjude408 for hardcore Twitter aficionados! RT @Britopian: from @mashable 6 Gorgeous Twitter Visualizations http:\/\/bit.ly\/Pa1S","to_user_id":null,"from_user":"kizzyb69","id":2404645183,"from_user_id":15618863,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/272966929\/colored_peace_1__normal.JPG","created_at":"Tue, 30 Jun 2009 15:08:03 +0000"},{"text":"Why I disagree with @mashable allowing users to pimp their FB Fan Pages - http:\/\/su.pr\/2pcQMq","to_user_id":null,"from_user":"sonnygill","id":2404644106,"from_user_id":26493,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/125678938\/sonnyavatar_normal.jpg","created_at":"Tue, 30 Jun 2009 15:07:58 +0000"},{"text":"6 Gorgeous Twitter Visualizations - http:\/\/bit.ly\/prlZo (via @mashable)","to_user_id":null,"from_user":"dvstweets","id":2404630357,"from_user_id":4774819,"iso_language_code":"en","source":"<a href="http:\/\/desktop.seesmic.com\/">Seesmic Desktop<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/273429500\/PICT0683_2_normal.JPG","created_at":"Tue, 30 Jun 2009 15:06:58 +0000"},{"text":"RT @mashable: 6 Gorgeous Twitter Visualizations - http:\/\/bit.ly\/prlZo [My fav is the 2nd one - Just Landed. Creative use of twitter data]","to_user_id":null,"from_user":"bwasson","id":2404624925,"from_user_id":7733772,"iso_language_code":"en","source":"<a href="http:\/\/www.twhirl.org\/">twhirl<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/102693349\/dad_normal.jpg","created_at":"Tue, 30 Jun 2009 15:06:34 +0000"},{"text":"RT @mashable BREAKING: The Pirate Bay Sold For $7.8 Million http:\/\/bit.ly\/gCb9k (via @tweetmeme)","to_user_id":null,"from_user":"PJ_MG","id":2404619510,"from_user_id":17157206,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/221740994\/grrrr_normal.jpg","created_at":"Tue, 30 Jun 2009 15:06:11 +0000"},{"text":"Hey Pete @mashable - Thought you might like our top 10 list of the Sweetest Tweets! http:\/\/bit.ly\/tweetest (site is SFW :)","to_user_id":null,"from_user":"Playboy","id":2404612637,"from_user_id":1270428,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/274009313\/olivia-playboy_normal.jpg","created_at":"Tue, 30 Jun 2009 15:05:42 +0000"}],"since_id":0,"max_id":2404676705,"refresh_url":"?since_id=2404676705&q=%40mashable","results_per_page":15,"next_page":"?page=2&max_id=2404676705&q=%40mashable","completed_in":0.021787,"page":1,"query":"%40mashable"} \ No newline at end of file diff --git a/test/json/results_per_page.json b/test/json/results_per_page.json new file mode 100644 index 0000000..91d6b69 --- /dev/null +++ b/test/json/results_per_page.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 17:41:31 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb014 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb014.twitter.com +Expires: Tue, 30 Jun 2009 17:46:31 GMT +Content-Length: 14798 +Vary: Accept-Encoding +X-Varnish: 1101483208 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb014.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"I just got a text from this guy. Apparently there are some really cheap flights to Boston, so. Celtics, Sox-Fuck You. http:\/\/mypict.me\/6Hkj","to_user_id":null,"from_user":"KunleIRAK","id":2406174594,"from_user_id":1273378,"iso_language_code":"en","source":"<a href="http:\/\/ubertwitter.com">UberTwitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/231309080\/Picture_152_normal.png","created_at":"Tue, 30 Jun 2009 16:56:56 +0000"},{"text":"Maine Red Claws Announce Affiliation with Boston Celtics, Charlotte Bobcats http:\/\/bit.ly\/mv9ti\n #maine #exceptionmag","to_user_id":null,"from_user":"MaineNewsFeed","id":2405562695,"from_user_id":24394042,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/282011246\/twitter_normal.jpg","created_at":"Tue, 30 Jun 2009 16:13:44 +0000"},{"text":"Hey @bowwow614 you like the boston celtics? (officialbowwow live > http:\/\/ustre.am\/3gi1)","to_user_id":null,"from_user":"jabezzy","id":2405493447,"from_user_id":7295401,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/268013780\/Firefox_wallpaper_normal.png","created_at":"Tue, 30 Jun 2009 16:08:42 +0000"},{"text":"@sportsguy33 Give it up SG! You love Kobe. We get it you have to pretend because your from Boston and a celtics fan by birth but you love 24","to_user_id":14826663,"to_user":"sportsguy33","from_user":"RossChancey","id":2405484453,"from_user_id":22585278,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/267416658\/IMG_0070_normal.jpg","created_at":"Tue, 30 Jun 2009 16:08:04 +0000"},{"text":"Hey @bowwow614 do you like the boston celtics? (officialbowwow live > http:\/\/ustre.am\/3gi1)","to_user_id":null,"from_user":"jabezzy","id":2405126630,"from_user_id":7295401,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/268013780\/Firefox_wallpaper_normal.png","created_at":"Tue, 30 Jun 2009 15:42:51 +0000"},{"text":"fuck the boston celtics redsocks and the patroits it all about LA what that shit do","to_user_id":null,"from_user":"Tryoneon09","id":2405000682,"from_user_id":22994321,"iso_language_code":"en","source":"<a href="http:\/\/twitterhelp.blogspot.com\/2008\/05\/twitter-via-mobile-web-mtwittercom.html">mobile web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/270702187\/m_6190ada48e5e477d9823a35859a74eb8_normal.jpg","created_at":"Tue, 30 Jun 2009 15:33:42 +0000"},{"text":"Whaaat! Cleveland needs jesus now. RT @teamflightbros: Looks like Rasheed Wallace will be joining the Boston Celtics","to_user_id":null,"from_user":"W_H_Swagspeare","id":2404998050,"from_user_id":15446736,"iso_language_code":"en","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/275819288\/green_3238_DSC00549_normal.JPG","created_at":"Tue, 30 Jun 2009 15:33:31 +0000"},{"text":"RT @teamflightbros: Looks like Rasheed Wallace will be joining the Boston Celtics <Telltale signs that the Celtic Regime is Done!>","to_user_id":null,"from_user":"TORIANBEAN14","id":2404652691,"from_user_id":7252095,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/276668687\/green_8262_MoneyBeanHawk_normal.jpg","created_at":"Tue, 30 Jun 2009 15:08:36 +0000"},{"text":"Looks like Rasheed Wallace will be joining the Boston Celtics","to_user_id":null,"from_user":"teamflightbros","id":2404621294,"from_user_id":14010514,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/184336657\/1972930_normal.jpg","created_at":"Tue, 30 Jun 2009 15:06:18 +0000"},{"text":"Marbury hopes to return to Celtics: Frank Dell'Apa and Marc J. Spears of The Boston Globe are reporting that so.. http:\/\/bit.ly\/1LP0x","to_user_id":null,"from_user":"nba2k","id":2404189290,"from_user_id":9389060,"iso_language_code":"en","source":"<a href="http:\/\/hellotxt.com\/twitterfeed">twitterfeed via HelloTxt<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/237664396\/nba-2klogo1_normal.jpg","created_at":"Tue, 30 Jun 2009 14:34:17 +0000"},{"text":"Boston Celtics Affiliated with New NBDL Team #sports http:\/\/bit.ly\/4c0fI","to_user_id":null,"from_user":"sportsforyou","id":2403645592,"from_user_id":22150857,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/264246839\/sports1_normal.jpg","created_at":"Tue, 30 Jun 2009 13:50:58 +0000"},{"text":"@ http:\/\/bit.ly\/3bC9 The CMSB: Danny Ainge Talks About The Red Claws: Boston Celtics GM Dann.. http:\/\/bit.ly\/VxgB9","to_user_id":null,"from_user":"RJE32","id":2402999782,"from_user_id":16057904,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/202121309\/5e71_normal.jpg","created_at":"Tue, 30 Jun 2009 12:53:36 +0000"},{"text":"Boston, MA- Cool Sports Blog- BleacherReport.com: http:\/\/BleacherReport.com\n#Boston #BostonSports #RedSox #Patriots #Celtics #Bruins","to_user_id":null,"from_user":"BeantownTwits","id":2401720353,"from_user_id":21418063,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288234167\/BeantownTwits_logo__normal.jpg","created_at":"Tue, 30 Jun 2009 10:10:46 +0000"},{"text":"#boston #sports Red Claws, Celtics make their partnership official - Maine Sunday Telegram http:\/\/tinyurl.com\/kjnr2j","to_user_id":null,"from_user":"soxpatsceltsbs","id":2401419659,"from_user_id":17267530,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/213637422\/boston_normal.jpg","created_at":"Tue, 30 Jun 2009 09:23:29 +0000"},{"text":"@ http:\/\/bit.ly\/3bC9 Hudson No 58 pick by Boston Celtics Topix: This will search the titles .. http:\/\/bit.ly\/EAblL","to_user_id":null,"from_user":"RJE32","id":2401176243,"from_user_id":16057904,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/202121309\/5e71_normal.jpg","created_at":"Tue, 30 Jun 2009 08:46:15 +0000"},{"text":"Life After Being a Boston Celtics Dancer\u2026 \u00ab Boston Women's Wellness: Boston Women's Wellness. by Healthw.. http:\/\/bit.ly\/11E3l0","to_user_id":null,"from_user":"fitforsuccess","id":2400713874,"from_user_id":13099428,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/151582536\/ACEcert_100x44_normal.gif","created_at":"Tue, 30 Jun 2009 07:37:30 +0000"},{"text":"#boston #sports Celtics going shopping as NBA free-agent market opens - Enterprise http:\/\/tinyurl.com\/n99wbq","to_user_id":null,"from_user":"soxpatsceltsbs","id":2400635186,"from_user_id":17267530,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/213637422\/boston_normal.jpg","created_at":"Tue, 30 Jun 2009 07:26:40 +0000"},{"text":"Yes! finished writing a long paragraph about the Boston Celtics history","to_user_id":null,"from_user":"KingRamon","id":2400464294,"from_user_id":17789907,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288523341\/Emerald_Square_normal.gif","created_at":"Tue, 30 Jun 2009 07:03:47 +0000"},{"text":"Chilling Textin da boo, {Boston Celtics All Day}","to_user_id":null,"from_user":"Dabullyungmarc","id":2400105679,"from_user_id":25493743,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/289924022\/m_df89c17b16e94068833ca698b103dbc9_normal.jpg","created_at":"Tue, 30 Jun 2009 06:19:20 +0000"},{"text":"Life After Being a Boston Celtics Dancer\u2026 \u00ab Boston Women's Wellness http:\/\/bit.ly\/2ynAnY","to_user_id":null,"from_user":"OfflineWebCoach","id":2398118996,"from_user_id":13581954,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/188158916\/ginger-vsmall_normal.jpg","created_at":"Tue, 30 Jun 2009 03:12:53 +0000"},{"text":"Boston Not Wanted By Sheed: Want to blog for Celtics 17? Learn more!\nCelticsBlog: Ainge made numerous offers to .. http:\/\/tinyurl.com\/l87t5g","to_user_id":null,"from_user":"sportsfan2009","id":2397919325,"from_user_id":8809983,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/111512207\/thumb_normal.jpg","created_at":"Tue, 30 Jun 2009 02:57:47 +0000"},{"text":"Life After Being a Boston Celtics Dancer\u2026 \u00ab Boston Women's Wellness: Boston Women's Wellness. by Healthw.. http:\/\/bit.ly\/qd6bF","to_user_id":null,"from_user":"LibertyChiro","id":2397894299,"from_user_id":19243957,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/237222959\/Herman_headshot_normal.jpg","created_at":"Tue, 30 Jun 2009 02:55:49 +0000"},{"text":"Today's Reinvention: Reinvention in the Celtics OffSeason | Sports of Boston http:\/\/bit.ly\/17XOWU","to_user_id":null,"from_user":"reinventionist","id":2397885592,"from_user_id":15230490,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/202185949\/TonyWanless_normal.JPG","created_at":"Tue, 30 Jun 2009 02:55:08 +0000"},{"text":"Life After Being a Boston Celtics Dancer\u2026 \u00ab Boston Women's Wellness: Boston Women's Wellness. by Healthw.. http:\/\/tinyurl.com\/nxmje8","to_user_id":null,"from_user":"drrodcruz","id":2397738256,"from_user_id":15897236,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/199815498\/rodanita_normal.jpg","created_at":"Tue, 30 Jun 2009 02:43:48 +0000"},{"text":"Life After Being a Boston Celtics Dancer\u2026 \u00ab Boston Women's Wellness http:\/\/bit.ly\/9kmc0","to_user_id":null,"from_user":"DrSchurger","id":2397736923,"from_user_id":4148919,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/74223467\/fred_suit_normal.jpg","created_at":"Tue, 30 Jun 2009 02:43:42 +0000"},{"text":"Life After Being a Boston Celtics Dancer\u2026 \u00ab Boston Women's Wellness http:\/\/bit.ly\/1tIqbO","to_user_id":null,"from_user":"nikrca","id":2397715253,"from_user_id":7735766,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/120986749\/Me_at_Mingles_03-05-09_normal.jpg","created_at":"Tue, 30 Jun 2009 02:42:02 +0000"},{"text":"Life After Being a Boston Celtics Dancer\u2026 \u00ab Boston Women's Wellness: Boston Women's Wellness. by Healthw.. http:\/\/bit.ly\/3DNYf4","to_user_id":null,"from_user":"LongevityNowPro","id":2397435900,"from_user_id":22228259,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/264290732\/lnp-pic-300x269_normal.jpg","created_at":"Tue, 30 Jun 2009 02:20:27 +0000"},{"text":"@jordan knight Does he play for the Boston Celtics?","to_user_id":385506,"to_user":"Jordan","from_user":"nkotballday","id":2397285760,"from_user_id":21718336,"iso_language_code":"en","source":"<a href="http:\/\/help.twitter.com\/index.php?pg=kb.page&id=75">txt<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/285023292\/3_normal.jpg","created_at":"Tue, 30 Jun 2009 02:08:59 +0000"},{"text":"Rasheed Walace coming to the 17 time world champion Boston Celtics...TRUST ME !!!!!!!!!!!!!!!!","to_user_id":null,"from_user":"bosoxyaz8","id":2397197739,"from_user_id":17768500,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 02:02:16 +0000"},{"text":"YourCeres.com says: Life After Being a Boston Celtics Dancer\u2026 \u00ab Boston Women's Wellness http:\/\/bit.ly\/qd6bF","to_user_id":null,"from_user":"cereslivingcash","id":2396999106,"from_user_id":21807117,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/261592462\/mycereslogo2_normal.jpg","created_at":"Tue, 30 Jun 2009 01:46:53 +0000"}],"since_id":0,"max_id":2406174594,"refresh_url":"?since_id=2406174594&q=Boston+Celtics","results_per_page":30,"next_page":"?page=2&max_id=2406174594&rpp=30&q=Boston+Celtics","completed_in":0.0606,"page":1,"query":"Boston+Celtics"} \ No newline at end of file diff --git a/test/json/superhero_since.json b/test/json/superhero_since.json new file mode 100644 index 0000000..5735856 --- /dev/null +++ b/test/json/superhero_since.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 17:13:05 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb011 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb011.twitter.com +Expires: Tue, 30 Jun 2009 17:18:05 GMT +Content-Length: 7604 +Vary: Accept-Encoding +X-Varnish: 437073229 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb011.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"If one day I were to feel like a superhero cashier, that day would be today. Customers thought I shortchanged them; I proved I didn't; b ...","to_user_id":null,"from_user":"lappelt","id":2406377448,"from_user_id":24959997,"iso_language_code":"en","source":"<a href="http:\/\/help.twitter.com\/index.php?pg=kb.page&id=75">txt<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/271974370\/n1164150101_30102866_40_normal.jpg","created_at":"Tue, 30 Jun 2009 17:11:12 +0000"},{"text":"@Ikariniku Not really. #comics != superhero books, and SH titles don't all feature super-STR. Even then, the connotations don't change.","to_user_id":17589171,"to_user":"Ikariniku","from_user":"fodigg","id":2406339408,"from_user_id":6407009,"iso_language_code":"en","source":"<a href="http:\/\/twitterrific.com">Twitterrific<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/88886212\/rebel_icon_normal.jpg","created_at":"Tue, 30 Jun 2009 17:08:27 +0000"},{"text":"RT @FTAlphaville Wanted: Superhero: For anyone counting on China to pull the world out of recession this little.. http:\/\/tinyurl.com\/ntu9tm","to_user_id":null,"from_user":"gneutmil","id":2406334791,"from_user_id":20149230,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/249065319\/seal2_LR_normal.jpg","created_at":"Tue, 30 Jun 2009 17:08:06 +0000"},{"text":"Captain America lives again. They never really DIE, do they? Ah, the life of a superhero. http:\/\/bit.ly\/Bnyml","to_user_id":null,"from_user":"PaulToon","id":2406322647,"from_user_id":4785752,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/139096257\/paulAttitash_normal.jpg","created_at":"Tue, 30 Jun 2009 17:07:13 +0000"},{"text":"Wanted: Superhero to save the world: For anyone counting on China to pull the world out of recession this little.. http:\/\/tinyurl.com\/ntu9tm","to_user_id":null,"from_user":"FTAlphaville","id":2406280721,"from_user_id":725280,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/63400807\/LR_normal.png","created_at":"Tue, 30 Jun 2009 17:04:18 +0000"},{"text":"Wanted: Superhero to save the world http:\/\/cli.gs\/trJ1h","to_user_id":null,"from_user":"ftalphabiz","id":2406278856,"from_user_id":475159,"iso_language_code":"en","source":"<a href="http:\/\/twitterfeed.com">twitterfeed<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/70976743\/LR_normal.png","created_at":"Tue, 30 Jun 2009 17:04:11 +0000"},{"text":"RT @MarkClayson: 80s Superhero Alert: Motorcycle Features Full-Sized Sidecar [Motorcycles] http:\/\/tinyurl.com\/lunshv This is AWESOME!","to_user_id":null,"from_user":"MikeLambert","id":2406192950,"from_user_id":1261679,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/58138109\/mike_20small_20headshot_20copy_normal.jpg","created_at":"Tue, 30 Jun 2009 16:58:16 +0000"},{"text":"slacking in my site recommendations so.. great site for generators(zombie, superhero ect...)http:\/\/www.ugo.com\/channels\/comics\/heroMachine2\/","to_user_id":null,"from_user":"engineer_nerd","id":2406192304,"from_user_id":337734,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/178712307\/23_normal.jpg","created_at":"Tue, 30 Jun 2009 16:58:13 +0000"},{"text":"I just took the "Which Superhero Would You Be Compatible With?" quiz and got: Spider-Man! Try it: http:\/\/bit.ly\/XlkNE","to_user_id":null,"from_user":"NikiLovezJB","id":2406192004,"from_user_id":5022059,"iso_language_code":"en","source":"<a href="http:\/\/lolquiz.com">LOL quiz<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/248709092\/090523_120408_normal.jpg","created_at":"Tue, 30 Jun 2009 16:58:12 +0000"},{"text":"@primehex LMAO @BarackObama invisible superhero","to_user_id":10280449,"to_user":"primehex","from_user":"caddymob","id":2406180146,"from_user_id":4010973,"iso_language_code":"es","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/270568526\/ugh_normal.jpg","created_at":"Tue, 30 Jun 2009 16:57:20 +0000"},{"text":"RT @BarackObama Does this mean you'll be like a superhero now and be able to become invisible whenever you want? We should focus on that.","to_user_id":null,"from_user":"caddymob","id":2406171711,"from_user_id":4010973,"iso_language_code":"en","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/270568526\/ugh_normal.jpg","created_at":"Tue, 30 Jun 2009 16:56:43 +0000"},{"text":"@ignignokt_ I'm going to refer to MY full name as my superhero name!","to_user_id":12338629,"to_user":"ignignokt_","from_user":"metroidbaby","id":2406104155,"from_user_id":8976,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/52638915\/larva_normal.PNG","created_at":"Tue, 30 Jun 2009 16:51:53 +0000"},{"text":"@aalgar Hey, can't be worse than superhero comics.","to_user_id":122639,"to_user":"aalgar","from_user":"Padt","id":2406086495,"from_user_id":3715950,"iso_language_code":"en","source":"<a href="http:\/\/www.twhirl.org\/">twhirl<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/270540811\/0624a4f1_normal.jpg","created_at":"Tue, 30 Jun 2009 16:50:40 +0000"},{"text":"Scuds is a Superhero! RT @kausatoday: Rob Scuderi was invited to the U.S. Olympic Training camp. His reputation and his dollars grow.","to_user_id":null,"from_user":"omgitsJen","id":2406083695,"from_user_id":17008009,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/250612814\/0407091831_normal.jpg","created_at":"Tue, 30 Jun 2009 16:50:29 +0000"},{"text":"phandroid: SuperHero: HTC Sense on HTC Dream\/G1 - http:\/\/techwatching.com\/cluster\/450038","to_user_id":null,"from_user":"techwatching","id":2406037189,"from_user_id":418318,"iso_language_code":"fr","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/64158478\/techwatching_twitter_bigger_normal.png","created_at":"Tue, 30 Jun 2009 16:47:16 +0000"}],"since_id":2378630889,"max_id":2406377448,"refresh_url":"?since_id=2406377448&q=superhero+since%3A2009-06-29","results_per_page":15,"next_page":"?page=2&max_id=2406377448&q=superhero+since%3A2009-06-29","warning":"since_id removed for pagination.","completed_in":0.031082,"page":1,"query":"superhero+since%3A2009-06-29"} \ No newline at end of file diff --git a/test/json/to_techcrunch.json b/test/json/to_techcrunch.json new file mode 100644 index 0000000..6fed2b2 --- /dev/null +++ b/test/json/to_techcrunch.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:08:16 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb004 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb004.twitter.com +Expires: Tue, 30 Jun 2009 15:13:16 GMT +Content-Length: 7008 +Vary: Accept-Encoding +X-Varnish: 131231971 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb004.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"@TechCrunch @guardiantech chCrunch6rounds Launches Video Communication Platform","to_user_id":627,"to_user":"TechCrunch","from_user":"GeorgeatUWW","id":2404549122,"from_user_id":9563410,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/222180952\/online4_normal.jpg","created_at":"Tue, 30 Jun 2009 15:01:14 +0000"},{"text":"@TechCrunch No OSX support is a big fail these days.","to_user_id":627,"to_user":"TechCrunch","from_user":"shaunw","id":2404548478,"from_user_id":299325,"iso_language_code":"en","source":"<a href="http:\/\/www.atebits.com\/">Tweetie<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/24466362\/wolf-me_normal.jpg","created_at":"Tue, 30 Jun 2009 15:01:10 +0000"},{"text":"@TechCrunch Shame its near impossible to buy Ricoh in the US.","to_user_id":627,"to_user":"TechCrunch","from_user":"michaeltroy","id":2403698517,"from_user_id":3367760,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/279801143\/me_normal.jpeg","created_at":"Tue, 30 Jun 2009 13:55:25 +0000"},{"text":"@TechCrunch ,.m..m.m","to_user_id":627,"to_user":"TechCrunch","from_user":"deleo77a","id":2403007843,"from_user_id":25536874,"iso_language_code":"pl","source":"<a href="http:\/\/www.friendbar.com">Friendbar<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 12:54:25 +0000"},{"text":"@TechCrunch Pivate Dating Online www.privatedatingonline.com","to_user_id":627,"to_user":"TechCrunch","from_user":"privatedating","id":2403004342,"from_user_id":22764544,"iso_language_code":"it","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 12:54:04 +0000"},{"text":"@TechCrunch Please check out . http:\/\/friendfeed.com\/mobile-web-server1 You can get instant news about FineWS mobile web server.","to_user_id":627,"to_user":"TechCrunch","from_user":"gpmarket","id":2402277385,"from_user_id":15829983,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/279995037\/spider_normal.jpg","created_at":"Tue, 30 Jun 2009 11:30:22 +0000"},{"text":"@TechCrunch Free! You can build web site with FineWS2.2+PHP+MySQL On your phone. http:\/\/bit.ly\/q19Bn","to_user_id":627,"to_user":"TechCrunch","from_user":"gpmarket","id":2402275023,"from_user_id":15829983,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/279995037\/spider_normal.jpg","created_at":"Tue, 30 Jun 2009 11:30:08 +0000"},{"text":"@TechCrunch Please check out http:\/\/bit.ly\/q19Bn\n You can find new mobile web server on smartphone.","to_user_id":627,"to_user":"TechCrunch","from_user":"gpmarket","id":2402273144,"from_user_id":15829983,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/279995037\/spider_normal.jpg","created_at":"Tue, 30 Jun 2009 11:29:57 +0000"},{"text":"@TechCrunch Just cool, The mobile web server on Nokia, iphone, windows mobile. http:\/\/bit.ly\/q19Bn","to_user_id":627,"to_user":"TechCrunch","from_user":"gpmarket","id":2402269718,"from_user_id":15829983,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/279995037\/spider_normal.jpg","created_at":"Tue, 30 Jun 2009 11:29:32 +0000"},{"text":"@TechCrunch i am not big a fan of iphone. can you suggest between n97 and samsung omnia?","to_user_id":627,"to_user":"TechCrunch","from_user":"pankajagarwal","id":2402240000,"from_user_id":11417996,"iso_language_code":"en","source":"<a href="http:\/\/83degrees.com\/to\/powertwitter">Power Twitter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288564714\/my_normal.jpg","created_at":"Tue, 30 Jun 2009 11:25:30 +0000"},{"text":"@TechCrunch - Only if you don't already have an iPhone .","to_user_id":627,"to_user":"TechCrunch","from_user":"innov","id":2402068647,"from_user_id":4210299,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 11:01:59 +0000"},{"text":"@TechCrunch there pretty cool i would","to_user_id":627,"to_user":"TechCrunch","from_user":"jizzlepistol25","id":2402045094,"from_user_id":16716476,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/208851391\/0502090809_1__normal.jpg","created_at":"Tue, 30 Jun 2009 10:58:58 +0000"},{"text":"@TechCrunch offcourse not :-P","to_user_id":627,"to_user":"TechCrunch","from_user":"kedarkekan","id":2401950968,"from_user_id":19773381,"iso_language_code":"en","source":"<a href="http:\/\/twitterfox.net\/">TwitterFox<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/249532647\/DSC07115_normal.JPG","created_at":"Tue, 30 Jun 2009 10:45:21 +0000"},{"text":"@Techcrunch reporting that Pirate Bay was sold http:\/\/is.gd\/1iYLw","to_user_id":627,"to_user":"TechCrunch","from_user":"mikesheetal","id":2401627397,"from_user_id":9633,"iso_language_code":"en","source":"<a href="http:\/\/www.twhirl.org\/">twhirl<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/276215686\/mikesheetal_portrait_200906_2_normal.jpg","created_at":"Tue, 30 Jun 2009 09:56:43 +0000"},{"text":"@techcrunch you are the top retweeted person on http:\/\/www.retweetradar.com\/ right now!","to_user_id":627,"to_user":"TechCrunch","from_user":"retweetradar","id":2401278921,"from_user_id":3168895,"iso_language_code":"en","source":"<a href="http:\/\/www.retweetradar.com">retweetradar<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/71600323\/rt_square_normal.jpg","created_at":"Tue, 30 Jun 2009 09:01:39 +0000"}],"since_id":0,"max_id":2404549122,"refresh_url":"?since_id=2404549122&q=to%3Atechcrunch","results_per_page":15,"next_page":"?page=2&max_id=2404549122&q=to%3Atechcrunch","completed_in":0.027709,"page":1,"query":"to%3Atechcrunch"} \ No newline at end of file diff --git a/test/json/traffic_question.json b/test/json/traffic_question.json new file mode 100644 index 0000000..8d8ccd2 --- /dev/null +++ b/test/json/traffic_question.json @@ -0,0 +1,20 @@ +HTTP/1.1 200 OK +Date: Tue, 30 Jun 2009 15:48:56 GMT +Server: hi +Status: 200 OK +X-Served-From: searchdb026 +X-Timeline-Cache-Hit: Miss +Cache-Control: max-age=60, must-revalidate, max-age=300 +Content-Type: application/json; charset=utf-8 +X-Served-By: searchweb026.twitter.com +Expires: Tue, 30 Jun 2009 15:53:56 GMT +Content-Length: 7437 +Vary: Accept-Encoding +X-Varnish: 1825992692 +Age: 0 +Via: 1.1 varnish +X-Cache-Svr: searchweb026.twitter.com +X-Cache: MISS +Connection: close + +{"results":[{"text":"@HeatherMNesbitt spoke to sus there & settling fine! I'm stuck in traffic in city centre.... Muggy here too! You nearly there yet?","to_user_id":7538574,"to_user":"HeatherMNesbitt","from_user":"Maxi67","id":2405192283,"from_user_id":18821812,"iso_language_code":"en","source":"<a href="http:\/\/www.tweetdeck.com\/">TweetDeck<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/253663648\/CHRISES_6_MEG_normal.jpg","created_at":"Tue, 30 Jun 2009 15:47:27 +0000"},{"text":"Word?! Some cguy in a big ass truck just bumped me in traffic and gave me the peace sign to make up for it 0.o","to_user_id":null,"from_user":"Lorrainuh","id":2405165376,"from_user_id":6737713,"iso_language_code":"en","source":"<a href="http:\/\/help.twitter.com\/index.php?pg=kb.page&id=75">txt<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/212659284\/l_c2f9a70dba9c497ebc9aba7db03761c4_normal.jpg","created_at":"Tue, 30 Jun 2009 15:45:38 +0000"},{"text":"http:\/\/tinyurl.com\/n98bk3 -Ready to increase traffic and make money with Twitter?","to_user_id":null,"from_user":"mariamind","id":2405158542,"from_user_id":18013708,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/220877092\/1_normal.jpg","created_at":"Tue, 30 Jun 2009 15:45:11 +0000"},{"text":"what`s going on with the air traffic?.. seriously.. not cool","to_user_id":null,"from_user":"mmmmarta","id":2405130869,"from_user_id":22376763,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/238543803\/DSCF0562_normal.JPG","created_at":"Tue, 30 Jun 2009 15:43:11 +0000"},{"text":"Google Map traffic overlay is stunningly accurate. Just as my 'blue dot' hit the Red section- Bam! Stand still traffic. Magic?","to_user_id":null,"from_user":"tmwsiy","id":2405126867,"from_user_id":612618,"iso_language_code":"en","source":"<a href="http:\/\/www.stone.com\/Twittelator">Twittelator<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/213423923\/mics_normal.jpg","created_at":"Tue, 30 Jun 2009 15:42:52 +0000"},{"text":"@Bravado Isn't using your phone in traffic against the law now or something? :P","to_user_id":41104,"to_user":"Bravado","from_user":"tenkay","id":2405111425,"from_user_id":612238,"iso_language_code":"en","source":"<a href="http:\/\/twitterfox.net\/">TwitterFox<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/135492338\/for_otto_normal.png","created_at":"Tue, 30 Jun 2009 15:41:43 +0000"},{"text":"RT @simplyTiffb @RealWorldDCNEWZ Hey are you a blogger? interested in more traffic? Share your Real World DC postings with us, we'll RT","to_user_id":null,"from_user":"YoDiddy","id":2405101198,"from_user_id":7908311,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/244504568\/n15601235_34464363_3018_normal.jpg","created_at":"Tue, 30 Jun 2009 15:40:59 +0000"},{"text":"Does your home match your family's needs and activities? What are the traffic patterns through the house? More http:\/\/tinyurl.com\/m6jhyd","to_user_id":null,"from_user":"UNL_LancasterCo","id":2405085884,"from_user_id":7383028,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/123745075\/UNLtwitterN_normal.jpg","created_at":"Tue, 30 Jun 2009 15:39:52 +0000"},{"text":"RT @RealSolutions22 Grads: don't have a $300 line item in yr budget 4 traffic tickets? then obey the law even if you feel like a nerd!","to_user_id":null,"from_user":"Tips4Grads","id":2405050326,"from_user_id":16909969,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/259959518\/Grads_Take_Charge_SQ_4_Twitter_normal.jpg","created_at":"Tue, 30 Jun 2009 15:37:14 +0000"},{"text":"He was shot several times at a routine traffic stop. How could he forgive? http:\/\/tinyurl.com\/mhkpwq","to_user_id":null,"from_user":"700club","id":2405049106,"from_user_id":8663007,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/104821720\/700club_normal.jpg","created_at":"Tue, 30 Jun 2009 15:37:09 +0000"},{"text":"Why is the time of the day with the slowest traffic called rush hour??","to_user_id":null,"from_user":"Jewell30","id":2405047863,"from_user_id":14728016,"iso_language_code":"en","source":"<a href="http:\/\/ubertwitter.com">UberTwitter<\/a>","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 15:37:04 +0000"},{"text":"Online display advertising: The more traffic you get, the more revenue you get? Wrong. http:\/\/tinyurl.com\/muvwu5","to_user_id":null,"from_user":"kenzame","id":2405031733,"from_user_id":11363235,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/271942019\/KCV_normal.jpg","created_at":"Tue, 30 Jun 2009 15:35:54 +0000"},{"text":"Increase traffic to your site FREE. http:\/\/startavga.com\/join\/?a=11843 go to about us. learn then join. NO COST! Pretty cool!","to_user_id":null,"from_user":"AlaiaL","id":2405020614,"from_user_id":720637,"iso_language_code":"en","source":"<a href="http:\/\/www.adjix.com">Adjix<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69301726\/alaiaphoto_normal.jpg","created_at":"Tue, 30 Jun 2009 15:35:07 +0000"},{"text":"@rmonge4surf Apparently pingsta gets very little traffic. Are they still a startup?","to_user_id":147538,"to_user":"rmonge4surf","from_user":"mpkahuna7","id":2404998795,"from_user_id":22877146,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/269749105\/Youth_retreat_to_Shaver_3_1-1-09_normal.JPG","created_at":"Tue, 30 Jun 2009 15:33:34 +0000"},{"text":"@DameTwitt @tomlop RT Has anyone had any luck driving traffic to your website using Twitter? About 1-5 people a day :-)","to_user_id":19380940,"to_user":"DameTwitt","from_user":"coolrewards","id":2404995278,"from_user_id":14621405,"iso_language_code":"en","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/273527973\/peter_twitter_photo_normal.gif","created_at":"Tue, 30 Jun 2009 15:33:19 +0000"}],"since_id":0,"max_id":2405192283,"refresh_url":"?since_id=2405192283&q=traffic+%3F","results_per_page":15,"next_page":"?page=2&max_id=2405192283&q=traffic+%3F","completed_in":0.031956,"page":1,"query":"traffic+%3F"} \ No newline at end of file diff --git a/test/operators_test.rb b/test/operators_test.rb index 051e4ae..531f03b 100644 --- a/test/operators_test.rb +++ b/test/operators_test.rb @@ -1,91 +1,120 @@ require File.join(File.dirname(__FILE__), 'test_helper') class OperatorsTest < Test::Unit::TestCase # :nodoc: - context '@client.query :q => \'"happy hour"\'' do + context "quoted phrase" do setup do - @tweets = read_yaml :file => 'happy_hour_exact' + query = { :q => '"happy hour"' } + fake_query(query, 'happy_hour_exact.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets containing the exact phrase "happy hour"' do - assert @tweets.all?{ |t| t.text =~ /happy hour/i } + @tweets.each do |tweet| + assert_match /happy hour/i, tweet.text + end end end - context "@client.query :q => 'obama OR hillary'" do + context "OR" do setup do - @tweets = read_yaml :file => 'obama_or_hillary' + query = { :q => 'obama OR hillary' } + fake_query(query, 'obama_or_hillary.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets containing either "obama" or "hillary" (or both)' do - assert @tweets.all?{ |t| t.text =~ /obama/i || t.text =~ /hillary/i } + @tweets.each do |tweet| + assert_match /obama|hillary/i, tweet.text + end end end - context "@client.query :q => 'beer -root'" do + context "minus" do setup do - @tweets = read_yaml :file => 'beer_minus_root' + query = { :q => 'beer -root' } + fake_query(query, 'beer_minus_root.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets containing "beer" but not "root"' do - assert @tweets.all?{ |t| t.text =~ /beer/i || t.text !~ /root/i } + assert @tweets.all? { |tweet| + tweet.text =~ /beer/i || + tweet.text !~ /root/i + } end end - context "@client.query :q => '#haiku'" do + context "hashtag" do setup do - @tweets = read_yaml :file => 'hashtag_haiku' + query = { :q => '#haiku' } + fake_query(query, 'hashtag_haiku.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets containing the hashtag "haiku"' do - assert @tweets.all?{ |t| t.text =~ /#haiku/i } + @tweets.each do |tweet| + assert_match /#haiku/i, tweet.text + end end end - context "@client.query :q => 'from: alexiskold'" do + context "from" do setup do - @tweets = read_yaml :file => 'from_alexiskold' + query = { :q => 'from:alexiskold' } + fake_query(query, 'from_alexiskold.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets sent from person "alexiskold"' do - assert @tweets.all?{ |t| t.from_user == 'alexiskold' } + @tweets.each do |tweet| + assert_equal 'alexiskold', tweet.from_user + end end end - context "@client.query :q => 'to:techcrunch'" do + context "to" do setup do - @tweets = read_yaml :file => 'to_techcrunch' + query = { :q => 'to:techcrunch' } + fake_query(query, 'to_techcrunch.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets sent to person "techcrunch"' do - assert @tweets.all?{ |t| t.text =~ /^@techcrunch/i } + @tweets.each do |tweet| + assert_match /^@techcrunch/i, tweet.text + end end end context "@client.query :q => '@mashable'" do setup do - @tweets = read_yaml :file => 'reference_mashable' + query = { :q => '@mashable' } + fake_query(query, 'reference_mashable.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets referencing person "mashable"' do - assert @tweets.all?{ |t| t.text =~ /@mashable/i } + @tweets.each do |tweet| + assert_match /@mashable/i, tweet.text + end end end - context "@client.query :q => '\"happy hour\" near:\"san francisco\"'" do + context "near" do should 'raise SearchOperatorError' do assert_raise TwitterSearch::SearchOperatorError do client = TwitterSearch::Client.new @@ -94,7 +123,7 @@ class OperatorsTest < Test::Unit::TestCase # :nodoc: end end - context "@client.query :q => 'near:NYC within:15mi'" do + context "within" do should 'raise SearchOperatorError' do assert_raise TwitterSearch::SearchOperatorError do client = TwitterSearch::Client.new @@ -103,9 +132,11 @@ class OperatorsTest < Test::Unit::TestCase # :nodoc: end end - context "@client.query :q => 'superhero since:2008-05-01'" do + context "since" do setup do - @tweets = read_yaml :file => 'superhero_since' + query = { :q => 'superhero since:2009-06-29' } + fake_query(query, 'superhero_since.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors @@ -116,16 +147,19 @@ class OperatorsTest < Test::Unit::TestCase # :nodoc: end end - should 'find tweets sent since date "2008-05-01" (year-month-day)' do + should 'find tweets sent since date "2009-06-29" (year-month-day)' do @tweets.each do |tweet| - assert convert_date(tweet.created_at) > DateTime.new(2008, 5, 1) + date = convert_date(tweet.created_at) + assert date > DateTime.new(2009, 6, 29) end end end - context "@client.query :q => 'ftw until:2008-05-03'" do + context "until" do setup do - @tweets = read_yaml :file => 'ftw_until' + query = { :q => 'ftw until:2009-06-30' } + fake_query(query, 'ftw_until.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors @@ -136,58 +170,79 @@ class OperatorsTest < Test::Unit::TestCase # :nodoc: end end - should "find tweets sent up to date 2008-05-03" do + should "find tweets sent up to date 2009-06-30" do @tweets.each do |tweet| - assert convert_date(tweet.created_at) < DateTime.new(2008, 5, 3, 11, 59) + assert convert_date(tweet.created_at) < DateTime.new(2009, 6, 30, 11, 59) end end end - context "@client.query :q => 'movie -scary :)'" do + context "positive attitude" do setup do - @tweets = read_yaml :file => 'movie_positive_tude' + query = { :q => 'movie -scary :)' } + fake_query(query, 'movie_positive_tude.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets containing "movie", but not "scary", and with a positive attitude' do - assert @tweets.all?{ |t| t.text =~ /movie/i && t.text !~ /scary/i && positive_attitude?(t.text) } + assert @tweets.all? { |tweet| + tweet.text =~ /movie/i && + tweet.text !~ /scary/i && + positive_attitude?(tweet.text) + } end end - context "@client.query :q => 'flight :('" do + context "negative attitude" do setup do - @tweets = read_yaml :file => 'flight_negative_tude' + query = { :q => 'flight :(' } + fake_query(query, 'flight_negative_tude.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets containing "flight" and with a negative attitude' do - assert @tweets.all?{ |t| t.text =~ /flight/i && negative_attitude?(t.text) } + assert @tweets.all? { |tweet| + tweet.text =~ /flight/i && + negative_attitude?(tweet.text) + } end end - context "@client.query :q => 'traffic ?'" do + context "question" do setup do - @tweets = read_yaml :file => 'traffic_question' + query = { :q => 'traffic ?' } + fake_query(query, 'traffic_question.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets containing "traffic" and asking a question' do - assert @tweets.all?{ |t| t.text =~ /traffic/i && t.text.include?('?') } + assert @tweets.all? { |tweet| + tweet.text =~ /traffic/i && + tweet.text.include?('?') + } end end - context "@client.query :q => 'hilarious filter:links'" do + context "filter" do setup do - @tweets = read_yaml :file => 'hilarious_links' + query = { :q => 'hilarious filter:links' } + fake_query(query, 'hilarious_links.json') + @tweets = TwitterSearch::Client.new.query(query) end should_have_default_search_behaviors should 'find tweets containing "hilarious" and linking to URLs' do - assert @tweets.all?{ |t| t.text =~ /hilarious/i && hyperlinks?(t.text) } + assert @tweets.all? { |tweet| + tweet.text =~ /hilarious/i && + hyperlinks?(tweet.text) + } end end end diff --git a/test/pagination_test.rb b/test/pagination_test.rb index a4254c1..75e580e 100644 --- a/test/pagination_test.rb +++ b/test/pagination_test.rb @@ -1,9 +1,11 @@ require File.join(File.dirname(__FILE__), 'test_helper') class PaginationTest < Test::Unit::TestCase # :nodoc: - context "@client.query :q => 'Boston Celtics', :rpp => '30'" do + context "results per page" do setup do - @tweets = read_yaml :file => 'results_per_page' + query = { :q => 'Boston Celtics', :rpp => '30' } + fake_query(query, 'results_per_page.json') + @tweets = TwitterSearch::Client.new.query(query) end should_find_tweets @@ -14,7 +16,9 @@ class PaginationTest < Test::Unit::TestCase # :nodoc: context "@client.query :q => 'a Google(or Twitter)whack', :rpp => '2'" do setup do - @tweets = read_yaml :file => 'only_one_result' + query = { :q => 'beginning class is in-depth ruby', :rpp => '2' } + fake_query(query, 'only_one_result.json') + @tweets = TwitterSearch::Client.new.query(query) end should 'not be able to get next page of @tweets' do @@ -22,19 +26,25 @@ class PaginationTest < Test::Unit::TestCase # :nodoc: end end - context "@client.query :q => 'almost Google(or Twitter)whack', :rpp => '1'" do + context "get next page" do setup do - @page_one = read_yaml :file => 'only_two_results' - @page_two = read_yaml :file => 'only_two_results_page_2' + query = { :q => 'thoughtbot', :rpp => '1' } + fake_query(query, 'page_one.json') + @page_one = TwitterSearch::Client.new.query(query) + + query = { :q => 'thoughtbot', :rpp => '1', :page => '2' } + fake_query(query, 'page_two.json') + @page_two = TwitterSearch::Client.new.query(query) end should 'be able to get next page of @tweets' do assert @page_one.has_next_page? - FakeWeb.register_uri( :get, - "#{TwitterSearch::Client::TWITTER_SEARCH_API_URL}?max_id=100&q=almost+a+Google%28or+is+it+Twitter%29whack&rpp=1&page=2", - :body => '{"results":[{"text":"Boston Celtics-Los Angeles Lakers, Halftime http://tinyurl.com/673s24","from_user":"nbatube","id":858836387,"language":"en","created_at":"Tue, 15 Jul 2008 09:27:57 +0000"}],"since_id":0,"max_id":100,"results_per_page":1,"page":2,"query":"almost+a+Google%28or+is+it+Twitter%29whack"}' - ) + query_string = "max_id=2407099995&q=thoughtbot&rpp=1&page=2" + uri = "#{TwitterSearch::Client::TWITTER_SEARCH_API_URL}?#{query_string}" + FakeWeb.register_uri(:get, uri, + :response => File.here / 'json' / "page_two.json") + next_page = @page_one.get_next_page assert_equal @page_two[0].created_at, next_page[0].created_at assert_equal @page_two[0].text, next_page[0].text diff --git a/test/search_test.rb b/test/search_test.rb index c938ad9..51bfede 100644 --- a/test/search_test.rb +++ b/test/search_test.rb @@ -1,7 +1,7 @@ require File.join(File.dirname(__FILE__), 'test_helper') class SearchTest < Test::Unit::TestCase # :nodoc: - context "client.query('Obama')" do + context "single word" do setup do fake_query('Obama', 'obama.json') @tweets = TwitterSearch::Client.new.query('Obama') @@ -14,7 +14,7 @@ class SearchTest < Test::Unit::TestCase # :nodoc: end end - context "client.query('twitter search')" do + context "two words" do setup do fake_query('twitter search', 'twitter_search.json') @tweets = TwitterSearch::Client.new.query('twitter search') @@ -27,7 +27,7 @@ class SearchTest < Test::Unit::TestCase # :nodoc: end end - context "client.query(:q => 'twitter search')" do + context "two words with :q option" do setup do fake_query({ :q => 'twitter search' }, 'twitter_search.json') @tweets = TwitterSearch::Client.new.query(:q => 'twitter search') @@ -40,7 +40,7 @@ class SearchTest < Test::Unit::TestCase # :nodoc: end end - context "a complicated search that results in a 404" do + context "response is a 404" do setup do uri = "http://search.twitter.com/search.json?q=rails+-from%3Adhh+from%3Alof&since_id=1791298088" FakeWeb.register_uri(:get, uri, @@ -56,7 +56,7 @@ class SearchTest < Test::Unit::TestCase # :nodoc: end end - context "a search that returns a 200 but an unparsable body" do + context "response is 200 but an unparsable body" do setup do uri = "http://search.twitter.com/search.json?rpp=100&q=ftc&since_id=2147483647&page=16" FakeWeb.register_uri(:get, uri, diff --git a/test/test_helper.rb b/test/test_helper.rb index 54f0b0a..ccd2449 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -25,11 +25,6 @@ def self.here FakeWeb.allow_net_connect = false class Test::Unit::TestCase - def read_yaml(opts = {}) - raise ArgumentError if opts[:file].nil? - YAML.load_file(File.here / 'yaml' / "#{opts[:file]}.yaml") - end - def parse_json(opts = {}) raise ArgumentError if opts[:file].nil? json = IO.read(File.here / 'json' / "#{opts[:file]}.json") @@ -38,7 +33,7 @@ def parse_json(opts = {}) def fake_query(query, file_name) sanitized_query = TwitterSearch::Client.new.sanitize_query(query) - uri = "http://search.twitter.com/search.json?#{sanitized_query}" + uri = "#{TwitterSearch::Client::TWITTER_SEARCH_API_URL}?#{sanitized_query}" FakeWeb.register_uri(:get, uri, :response => File.here / 'json' / file_name) end @@ -55,11 +50,13 @@ def convert_month(str) end def positive_attitude?(string) - [":)", "=)", ":-)", ":D"].any? { |emoticon| string.include?(emoticon) } + emoticons = [":)", "=)", ":-)", ":D", ": )"] + emoticons.any? { |emoticon| string.include?(emoticon) } end def negative_attitude?(string) - [":(", "=(", ":-(", ":P"].any? { |emoticon| string.include?(emoticon) } + emoticons = [":(", "=(", ":-(", ":P", ": ("] + emoticons.any? { |emoticon| string.include?(emoticon) } end def hyperlinks?(string) diff --git a/test/trends_test.rb b/test/trends_test.rb index 575ba52..9598261 100644 --- a/test/trends_test.rb +++ b/test/trends_test.rb @@ -1,7 +1,7 @@ require File.join(File.dirname(__FILE__), 'test_helper') class TrendsTest < Test::Unit::TestCase # :nodoc: - context "@client.trends" do + context "trends" do setup do @trends = parse_json :file => 'trends' end