Need help to get started with building this app

python

#1

Hello, I m python programmer and recently picked up this project for building a twitter app which shows all the tweets from or about a particular location.

Any suggestion on how do I get started would be great.

I have looked into python libraries for twitter.

My main concern is how do I get tweets being tweeted from a location, or how do I get place id of a location.


#2

You can get tweets from a place if you know the latitude and longitude by using either of these two endpoints:
statuses/filter
search/tweets

For example, using the TwitterAPI Python library:

from TwitterAPI import TwitterAPI
api = TwitterAPI(consumer_key, consumer_secret, access_token_key, access_token_secret)

then

r = api.request('statuses/filter', {'locations':'-74,40,-73,41'})
for item in r:
    print(item)

or

r = api.request('search/tweets', {'geocode':'40.5,-73.5,10mi'})
for item in r:
    print(item)