Comments (20)
Hello guys, it seems twitter has changed the info it provides, I no longer see the location info that I retrieved before with "span.Tweet-geo".
from getoldtweets-python.
I am also wondering the same thing. The geo attribute of each tweet always comes out empty. Look at issue #45.
Update: The query in tweetmanager.py for geo is incorrect– span.Tweet-geo anywhere in the html (checked tweet, tweetPQ, tweetHTML, tweet, and even the basic JSON file). Currently looking at how the JsonResponse is rendered to see if we can include information about location as well.
Further Update: Looks like there is no way to get lat/long data of tweets with this method (please correct me if I'm wrong). I just changed the code so that the geo parameter of Tweet returns the location of the user that tweeted the tweet from their profile (I find the user based on the tweet, then scrape the user's location posted on the profile). This isn't as accurate or as encompassing as getting lat/long info, but this is the best I could do and works for my purposes.
from getoldtweets-python.
Yes I can provide the info! Most of the changes I made are in the "getoldtweets" folder of my trend_map project.
However, I had put a pause on this project a couple months ago because overnight all of the code in Jefferson-Henrique's unofficial API stopped working– my intuition based on a few tests I ran is that twitter updated its software so its no longer compatible with the unofficial API. I may be wrong though– if it works for you please let me know!
from getoldtweets-python.
Dear Sam,
could you please send me your modified version? I would also need user sex.. is it possible to add?
Unfortunately I have no experience in scraping and in python to do it on my own.. :-(
Thank you in advance,
Francesco
from getoldtweets-python.
@SamOh Hey Sam! Wondering if you could provide the updated files to get around the geocode bug of the original version? Checked out your profile and had trouble finding the changes on there.
Thanks in advance!
Grace
from getoldtweets-python.
Hi
I am not able to scrap historical tweets. The --since and --until arguments are not working. Jeff can you please confirm.
from getoldtweets-python.
@SamOh I'm able to retrieve old tweets using Jefferson-Henrique getoldtweets. Obviously, as we encountered earlier, the geolocation part doesn't work. But I was wondering if you got around to fixing scraping the user's location posted on their profile? I tried running whats in your trend_map project and I get some errors.
`Arpans-MacBook-Pro:getoldtweets MacbookPro$ python3 Exporter.py --querysearch "trump" --since 2016-10-01 --until 2016-10-31
Searching...
Twitter weird response. Try to see on browser: https://twitter.com/search?q=%20since%3A2016-10-01%20until%3A2016-10-31%20trump&src=typd
Unexpected error: <class 'urllib.error.URLError'>
Done. Output file generated "output_got3.csv".
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 808, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/MacbookPro/PycharmProjects/cs446/trend_map-master/getoldtweets/got3/manager/TweetManager.py", line 146, in getJsonReponse
response = opener.open(url)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Exporter.py", line 76, in main
got3.manager.TweetManager.getTweets(tweetCriteria, receiveBuffer)
File "/Users/MacbookPro/PycharmProjects/cs446/trend_map-master/getoldtweets/got3/manager/TweetManager.py", line 34, in getTweets
json = TweetManager.getJsonReponse(tweetCriteria, refreshCursor, cookieJar)
File "/Users/MacbookPro/PycharmProjects/cs446/trend_map-master/getoldtweets/got3/manager/TweetManager.py", line 153, in getJsonReponse
sys.exit()
SystemExit
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Exporter.py", line 85, in
main(sys.argv[1:])
File "Exporter.py", line 78, in main
except arg:
TypeError: catching classes that do not inherit from BaseException is not allowed`
from getoldtweets-python.
Hello @arpan-ghosh, can you try with python2? The python3 it is kind of experimental.
from getoldtweets-python.
I used Python 2 and the geo attribute returns an empty string.
from getoldtweets-python.
I would also like the geo locations for tweets. Has anybody managed to get this working?
from getoldtweets-python.
Apparently there is no Geo/Location field returned by the method this project uses. The json returned by twitter has limited info. Your best bet is to collect all Twit IDs and query Twitter API to get more insights.
I am working on the same, once successful I'll update the code or may be just post it here.
from getoldtweets-python.
The following https://github.com/taspinar/twitterscraper repository gives everything (geo-location included). Happy Scrapping. :)
from getoldtweets-python.
Hey @TheSaintIndiano , I reviewed your code and even tried it on local. I dont see Geo for the tweets. Although there is Geo for Users, but that is not something we are looking for. Can you please explain where and how the geo code is being populated?
from getoldtweets-python.
I meant one can filter out tweets written based on the location.
eg. twitterscraper "Blockchain near:Seattle within:15mi" -o blockchain_tweets.json -l 1000
Hope it helps.
from getoldtweets-python.
What we are looking for is the geo-location of the tweet. The program already has mechanism to restrict tweets based on location exactly same way you have in your program.
ex. Exporter.py --querysearch "Blockchain" --near Seattle --within 15mi
from getoldtweets-python.
can i get the geo location in a separate columns
from getoldtweets-python.
Hi, did anybody get the geo location of Tweet working?
from getoldtweets-python.
Hi.
Does anybody get a solution to geo location? It is returning empty string.
from getoldtweets-python.
Hi, did anybody get the geo location of Tweet working?
Yes I can provide the info! Most of the changes I made are in the "getoldtweets" folder of my trend_map project.
However, I had put a pause on this project a couple months ago because overnight all of the code in Jefferson-Henrique's unofficial API stopped working– my intuition based on a few tests I ran is that twitter updated its software so its no longer compatible with the unofficial API. I may be wrong though– if it works for you please let me know!
Hi Sam, did you get any solution for geo values?
from getoldtweets-python.
Following this thread. Does anyone have the luck to get the geospatial data of tweets?
from getoldtweets-python.
Related Issues (20)
- Saving the tweets
- Mentioned Tweets HOT 2
- Getting mentions and hashtags HOT 2
- Finding tweet from ID HOT 2
- Running 'GetOldTweets -h' fails on windows
- retweets from other HOT 1
- Revert back from got.models.Tweet instance
- An error occured during an HTTP request: HTTP Error 404: Not Found HOT 1
- Unexpected error: <class 'urllib.error.HTTPError'> HOT 4
- Empty output_got.csv HOT 1
- Cant scrape tweets anymore - Twitter wierd response error HOT 15
- An error occured during an HTTP request: HTTP Error 404: Not Found HOT 14
- When running the latest version, the tweet returns the text content already cleaned out of URLs. I need them as well. HOT 5
- please anyone solve the new problem HOT 3
- Not working HOT 6
- @SMA
- HTTP: 403 Forbidden HOT 2
- `Twitter weird response` get empty out put HOT 1
- Legality
- 403: Forbidden when using getTweets python function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getoldtweets-python.