查找来自twitter的flume下载的推文的位置

时间:2014-05-03 04:26:51

标签: java twitter location geo flume

我使用了一些关键词并使用flume从twitter下载了推文。示例数据如下所示

{" filter_level":" medium","贡献者":null,"文字":"梅西,厄齐尔, CR7& Suarez Bertengger di Lamborghini t.co/SKk8xnnjl7","geo":null,"retweeted":false,"in_reply_to_screen_name" ;:null," possibly_sensitive":假,"截断":假,"朗":"在""实体" {"符号":[],"网址":[{" expanded_url":" dlvr.it/5XH5Vk","指数&#34 ;: [56,78]," DISPLAY_URL":" dlvr.it/5XH5Vk"," URL":" t.co/SKk8xnnjl7"} ]"#标签":[]," user_mentions":[]}," in_reply_to_status_id_str":空," ID":461450307856130048,& #34;源":" HTTP://dlvr.it \"相对= \" nofollow的\"> dlvr.it< / A>"" in_reply_to_user_id_str":空,"收藏":假,& #34; in_reply_to_status_id":null," retweet_count":0," created_at":" Wed Apr 30 10:21:41 +0000 2014",& #34; in_reply_to_user_id":空," FAVORITE_COUNT":0," ID_STR":" 461450307856130048""地方":空, "用户":{"位置":"订阅我们"," default_profile":false," profile_background_tile":true " statuses_count":158496,"朗":"恩"" profile_link_color":" 006400"&# 34; profile_banner_url":" pbs.twimg.com/profile_banners/251586988/1368528690"," ID":251586988"以下":空,&# 34;保护":假," favourites_count":1," profile_text_color":" 333333""描述":&#34 ;最新突发新闻&软件。\ r \ n \ r \ nAkun ini dijual Rp150.000","已验证":false," contributors_enabled":false," profile_sidebar_border_color": " 000000","名称":" TOP NEWS"," profile_background_color":" 000000"," created_at":" Sun Feb 13 12:54:44 +0000 2011"," is_translation_enabled":false," default_profile_image":false," FOLLOWERS_COUNT":37879" profile_image_url_https":" pbs.twimg.com/profile_images/449966329588482048/Rb4azNrv_normal.jpeg"," geo_enabled":假,&# 34; profile_background_image_url":" abs.twimg.com/images/themes/theme14/bg.gif"," profile_background_image_url_https":" abs.twimg.com/images /themes/theme14/bg.gif","follow_request_sent":null,"url":"google.com","utc_offset" ;:25200"的time_zone":"曼谷""通知":空," profile_use_background_image":真," FRIENDS_COUNT&# 34;:10," PROFIL e_sidebar_fill_color":" DDEEF6"" SCREEN_NAME":" 7HotNews"" ID_STR":" 251586988&#34 ;, " profile_image_url":" http://pbs.twimg.com/profile_images/449966329588482048/Rb4azNrv_normal.jpeg"" listed_count":19," is_translator":假}"坐标":空}

现在我必须从推文的位置找出推文的位置。我也遇到了一些网站,其中大多数答案都是" geo"以上json格式的字段给出了tweet的位置。但是对于我的大部分推文它都是null。 拜托,有人帮我这个...我只是翻了两个星期.... 提前致谢, RedDevil

1 个答案:

答案 0 :(得分:0)

您有两种类型的位置:地理位置和用户位置。 由于用户可以键入他们想要的任何内容,因此用户位置在大多数时间都不可用。 地理位置是查找推文的最佳方式,正如您所见,大多数用户都没有启用地理位置。 根据目的,您可以使用少数几个地理位置。