inst/unittests/test.twitter.r

test.twitter <- function()
{
	x <- "{\"results\":[{\"profile_image_url\":\"http://a1.twimg.com/profile_images/904661361/IMG00034-20100515-1550_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:21 +0000\",\"from_user\":\"YOtwittaDADDY\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"#random no basic bitch is safe on twitter! If I dont get you and tear you apart, @heartless_dex or @chefhomeboyjd will\",\"id\":20267740998,\"from_user_id\":108000717,\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://mobile.twitter.com&quot; rel=&quot;nofollow&quot;&gt;Mobile Web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a2.twimg.com/profile_images/839850446/n835436_43297164_3982_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:20 +0000\",\"from_user\":\"vmsweet123\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"RT @richard_solo: Giveaway thru: 8/09. Win RichardSolo Noise Canceling Headphones. Follow @Richard_Solo &amp; retweet http://bit.ly/bD8ezA\",\"id\":20267739854,\"from_user_id\":12289632,\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a3.twimg.com/profile_images/430611695/sm_profile_square_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:20 +0000\",\"from_user\":\"ScottMcLemore\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":85038,\"text\":\"@alevin Thanks also for all the insight tonight! Trying to DM you but it says you're not following me. What's your other twitter name?\",\"id\":20267739573,\"from_user_id\":2032996,\"to_user\":\"alevin\",\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://www.tweetdeck.com/&quot; rel=&quot;nofollow&quot;&gt;TweetDeck&lt;/a&gt;\"},{\"profile_image_url\":\"http://a0.twimg.com/profile_images/1083435260/black_rock_ramona_normal.png\",\"created_at\":\"Wed, 04 Aug 2010 01:45:18 +0000\",\"from_user\":\"zetacoes\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":70577019,\"text\":\"@xjazzy13 http://twitter.com/zetacoes/status/20254842627\",\"id\":20267738141,\"from_user_id\":1876460,\"to_user\":\"xJazzy13\",\"geo\":null,\"source\":\"&lt;a href=&quot;http://www.echofon.com/&quot; rel=&quot;nofollow&quot;&gt;Echofon&lt;/a&gt;\"},{\"profile_image_url\":\"http://a1.twimg.com/profile_images/350332457/110542_332748125_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:18 +0000\",\"from_user\":\"pepotan\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"\\u30de\\u30af\\u30c9\\u3082\\u3001twitter\\uff0b\\u30d6\\u30e9\\u30a6\\u30b6\\u30b2\\u30fc\\u3067\\u3001\\u30d7\\u30ed\\u30e2\\u3002 \\u30b3\\u30f3\\u30c6\\u30f3\\u30c4\\u306e\\u5185\\u5bb9\\u306f\\u3044\\u307e\\u3044\\u3061\\u3060\\u3051\\u3069\\u3001\\u5e83\\u544a\\u4ee3\\u7406\\u5e97\\u3068\\u5236\\u4f5c\\u4f1a\\u793e\\u304c\\u5132\\u304b\\u308b\\u4ed5\\u7d44\\u307f\\uff57 http://bit.ly/dtfwgs #McD_ckn\",\"id\":20267737693,\"from_user_id\":7864312,\"geo\":null,\"iso_language_code\":\"ja\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a3.twimg.com/profile_images/946831163/113082922_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:18 +0000\",\"from_user\":\"d_davidshi\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"HIT - HOW DO YOU GET 100 FREE TWITTER FOLLOWERS?  http://tinyurl.com/32n9eda\",\"id\":20267737116,\"from_user_id\":82204650,\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://dev.twitter.com/&quot; rel=&quot;nofollow&quot;&gt;API&lt;/a&gt;\"},{\"profile_image_url\":\"http://a3.twimg.com/profile_images/387119699/Picture_or_Video_002_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:17 +0000\",\"from_user\":\"aestrap\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"Whoa! The twitter site changed on my phone.\",\"id\":20267736765,\"from_user_id\":2258787,\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://mobile.twitter.com&quot; rel=&quot;nofollow&quot;&gt;Mobile Web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a1.twimg.com/profile_images/1070967993/J_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:17 +0000\",\"from_user\":\"jinnli\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":2408767,\"text\":\"@chrisoul \\u6628\\u5929\\u4e0a\\u6d77\\u65b9\\u9762\\u6765\\u62a5\\uff0cTwitter.com \\u7684\\u57df\\u540d\\u4e5f\\u89e3\\u5c01\\u4e86\\uff08\\u4f46\\u662f\\u6709\\u5927\\u90e8\\u5206IP\\u6254\\u5728\\u5c01\\uff09\\u3002\",\"id\":20267736571,\"from_user_id\":3150412,\"to_user\":\"chrisoul\",\"geo\":null,\"iso_language_code\":\"zh\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a1.twimg.com/profile_images/1077123381/20100714_000933_140_normal.gif\",\"created_at\":\"Wed, 04 Aug 2010 01:45:16 +0000\",\"from_user\":\"keshasuja\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"RT se Raul Gil acaba de visitar seu twitter - &quot;Twitter is over capacity.&quot; - Minha baleia \\u00e9 MACHO (:\",\"id\":20267735081,\"from_user_id\":103469135,\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a0.twimg.com/profile_images/1094336724/twitter_icon_from_annie_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:13 +0000\",\"from_user\":\"ColtChambers\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":108642403,\"text\":\"@shawnmock132 they dont have twitter\",\"id\":20267732425,\"from_user_id\":34795175,\"to_user\":\"shawnmock132\",\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a2.twimg.com/profile_images/1078874562/Foto_47_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:13 +0000\",\"from_user\":\"Sjoerd\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":16735834,\"text\":\"@Jarlrule @mitsuo @wilbertleering @zapache @ock12 @ehpo @henneaux no 4square!! SMS Twitter en #ichannel... Vanuit een dampend kroatie\",\"id\":20267732273,\"from_user_id\":905717,\"to_user\":\"Jarlrule\",\"geo\":{\"type\":\"Point\",\"coordinates\":[44.1138,15.2333]},\"iso_language_code\":\"nl\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot; rel=&quot;nofollow&quot;&gt;Twitter for iPhone&lt;/a&gt;\"},{\"profile_image_url\":\"http://a3.twimg.com/profile_images/576571611/Smoked_Tacos_2_jpg_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:13 +0000\",\"from_user\":\"creep4ward\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"Giveaway thru: 8/09. Win RichardSolo Noise Canceling Headphones. Follow @Richard_Solo &amp; retweet http://bit.ly/bD8ezA\",\"id\":20267732038,\"from_user_id\":85290503,\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a2.twimg.com/profile_images/1005104638/Picture_310re_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:13 +0000\",\"from_user\":\"LADiixBANKS\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"Ahhhh so matt finally got yu on the waveee! Lol RT @RitzNOCrackers: @myniggaLIP . ----&gt; @LADiixBANKS guess who has a twitter JIMMY LMAO\",\"id\":20267731542,\"from_user_id\":23608569,\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://seesmic.com/seesmic_mobile/android/&quot; rel=&quot;nofollow&quot;&gt;Seesmic for Android&lt;/a&gt;\"},{\"profile_image_url\":\"http://a2.twimg.com/profile_images/1093270058/never_let_you_go3_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:11 +0000\",\"from_user\":\"DenverBeliebers\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"getting off twitter!!!\",\"id\":20267729271,\"from_user_id\":80666587,\"geo\":null,\"iso_language_code\":\"no\",\"source\":\"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;\"},{\"profile_image_url\":\"http://a2.twimg.com/profile_images/1094119234/image_normal.jpg\",\"created_at\":\"Wed, 04 Aug 2010 01:45:10 +0000\",\"from_user\":\"overDRESSed_1\",\"metadata\":{\"result_type\":\"recent\"},\"to_user_id\":null,\"text\":\"Omg!!!!!! Twitter for iPhone won't work on my phone!!!!!! Having a meltdown!!!!\",\"id\":20267728785,\"from_user_id\":53192938,\"geo\":null,\"iso_language_code\":\"en\",\"source\":\"&lt;a href=&quot;http://www.echofon.com/&quot; rel=&quot;nofollow&quot;&gt;Echofon&lt;/a&gt;\"}],\"max_id\":20267740998,\"since_id\":0,\"refresh_url\":\"?since_id=20267740998&q=twitter\",\"next_page\":\"?page=2&max_id=20267740998&q=twitter\",\"results_per_page\":15,\"page\":1,\"completed_in\":0.017069,\"query\":\"twitter\"}"
	jdata <- fromJSON( x )
	checkTrue( is.list( jdata ) )
}

Try the rjson package in your browser

Any scripts or data that you put into this service are public.

rjson documentation built on Sept. 30, 2024, 9:43 a.m.