I'm trying to get tweets from a specific location using Tweepy but I get this error when I run the code
raise TweepError("Wrong number of locations points, "
tweepy.error.TweepError: Wrong number of locations points, it has to be a multiple of 4
In my code, I try to get tweets from New York City with the location coordinates for NY. How can I get tweets from NY alone? My guess is to use a range of coordinates say between x,y and y,z. How do I go about this?
Here is my code:
""" A listener handles tweets are the received from the stream.
This is a basic listener that just prints received tweets to stdout.
def on_data(self, data):
saveFile = open('newtweets.csv', 'a')
print ('failed ondata')
def on_error(self, status):
if __name__ == '__main__':
l = StdOutListener()
auth = OAuthHandler(consumer_key, consumer_secret)
#ASK FOR KEYWORD TO COLLECT DATA
user_keyword=input("What keyword do you want to mine?")
stream = Stream(auth, l)