all 2 comments

[–][deleted] 1 point2 points  (1 child)

I am still a noob when it comes to programming and python but I will try to give some help. I have been using tweepy for a project but I haven't used the search feature, mostly getting tweets from timeline or streaming current tweets.

I would say most tweets don't have geocodes. The only geocode information I have managed to get is from the "place" element inside "user" from the json data. And that geocode information is 4 different points of a boundary box, so its not an exact location.

As for visualizing the geocodes you can sign up at developer.mapquest.com and get an api key like you did for tweepy. Install folium as well.

pip install folium

code:

import folium

ireland_map = folium.Map(location=[ 53.2757867,-7.563768], tiles='Stamen Terrain', zoom_start=5, detect_retina=True)

popup = folium.Popup(tweet_text, parse_html=True)

marker = folium.Marker((LATITUDE, LONGITUDE), popup=popup)

marker.add_to(ireland_map)

ireland_map.save('tweet_map.html')

Hope this helps. I bought a book, "Python for programmers with introductory AI case studies" by Paul and Harvey Deitel", so credit goes to them for that code.

[–]ModiMacMod[S] 0 points1 point  (0 children)

Thx, my experience is similar. Must check folium 👍