tweets

How can we get tweets from specific country

こ雲淡風輕ζ 提交于 2019-11-27 19:18:32
问题 I've read a lot about this part and what I found is to write the geocode and search for tweets for example https://api.twitter.com/1.1/search/tweets.json?geocode=37.781157,-122.398720,1mi&count=10 according to what i found in twitter website Returns tweets by users located within a given radius of the given latitude/longitude. A maximum of 1,000 distinct "sub-regions" will be considered when using the radius modifier. Example Values: 37.781157,-122.398720,1mi The question!, how can we define

Getting tweet replies to a particular tweet from a particular user

我的梦境 提交于 2019-11-27 15:04:39
问题 I am trying to go through tweets of a particular user and get all replies on that tweet. I found that the APIv1.1 of twitter does not directly support it. Is there a hack or a workaround on getting the replies for a particular tweet. I am using python Streaming API. 回答1: There is a workaround using the REST API. You will need the id_str and @username of the author of the original tweet you want to find replies to. You should use the Search API for the "@username" of the author. Go through the

Find ALL tweets from a user (not just the first 3,200)

妖精的绣舞 提交于 2019-11-27 09:25:11
问题 With https://dev.twitter.com/docs/api/1/get/statuses/user_timeline I can get 3,200 most recent tweets. However, certain sites like http://www.mytweet16.com/ seems to bypass the limit, and my browse through the API documentation could not find anything. How do they do it, or is there another API that doesn't have the limit? 回答1: You can use twitter search page to bypass 3,200 limit. However you have to scroll down many times in the search results page. For example, I searched tweets from

remove unicode emoji using re in python

廉价感情. 提交于 2019-11-26 20:27:57
I tried to remove the emoji from a unicode tweet text and print out the result in python 2.7 using myre = re.compile(u'[\u1F300-\u1F5FF\u1F600-\u1F64F\u1F680-\u1F6FF\u2600-\u26FF\u2700-\u27BF]+',re.UNICODE) print myre.sub('', text) but it seems almost all the characters are removed from the text. I have checked several answers from other posts, unfortunately, none of them works here. Did I do anything wrong in re.compile()? here is an example output that all the characters were removed: “ ' //./” ! # # # … You are not using the correct notation for non-BMP unicode points; you want to use

remove unicode emoji using re in python

亡梦爱人 提交于 2019-11-26 07:36:12
问题 I tried to remove the emoji from a unicode tweet text and print out the result in python 2.7 using myre = re.compile(u\'[\\u1F300-\\u1F5FF\\u1F600-\\u1F64F\\u1F680-\\u1F6FF\\u2600-\\u26FF\\u2700-\\u27BF]+\',re.UNICODE) print myre.sub(\'\', text) but it seems almost all the characters are removed from the text. I have checked several answers from other posts, unfortunately, none of them works here. Did I do anything wrong in re.compile()? here is an example output that all the characters were