Here is the simple code I'm using:
import tweepy
result = tweepy.api.search(q="McDonalds ",rpp=1000,page=2, geocode= "34.085422,-117.900879,100mi" )
for tweet in result:
print tweet.text
print tweet.geo
It returns the results I want. In my IDE I get results like this:
@stevo_k14 I'm going back after mcdonalds haha
None
“@FunnyEvil: If bars can't serve drunk people, Mcdonalds shouldn't be able to serve fat people.”
{u'type': u'Point', u'coordinates': [33.9581, -118.1779]}
Mcdonalds for breakfast? Yup i think so :)
None
@JessicaCarrillo You make me want to go out to McDonalds right now!!!!! Lol good morning.
{u'type': u'Point', u'coordinates': [33.9443, -118.0038]}
Some return no location and some return location. What I'd really like to do is write the results straight to a csv file with Keyword, Tweet, Lat, Lon as my headers. Keyword would be "McDonalds" in this case. It would also be nice to have some ifelse statement to not write results unless they have location.
I am new to programming so your help is much appreciated! Thanks