8 lines
8.7 KiB
R
Raw Normal View History

2025-01-12 00:52:51 +08:00
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;nofo
jdata <- fromJSON( x )
checkTrue( is.list( jdata ) )
}