<reponame>lindsay0416/framework<filename>playground/NLP/twitter_crawler.py
# python-twiter only works for 3.5
import twitter

api = twitter.Api(consumer_key='TWmKyljuWlPAZx0tRv8KvfGYC',
                          consumer_secret='<KEY>',
                          access_token_key='<KEY>',
                          access_token_secret='<KEY>')
print(api.VerifyCredentials())

# See more: https://github.com/bear/python-twitter

# Apply filter and Crawl twits
results = api.GetSearch(
    raw_query="q=twitter%20&result_type=mixed&lang=en&since=2018-01-01&count=100")
print(results)

for twit in results:
    print(twit.text)

print(len(results))

# Save filtered twits to the database - for annotation and analysis

# python-twiter only works for 3.5
import twitter

api = twitter.Api(consumer_key='TWmKyljuWlPAZx0tRv8KvfGYC',
                          consumer_secret='<KEY>',
                          access_token_key='<KEY>',
                          access_token_secret='<KEY>')
print(api.VerifyCredentials())

# See more: https://github.com/bear/python-twitter

# Apply filter and Crawl twits
results = api.GetSearch(
    raw_query="q=twitter%20&result_type=mixed&lang=en&since=2018-01-01&count=100")
print(results)

for twit in results:
    print(twit.text)

print(len(results))

# Save filtered twits to the database - for annotation and analysis
# python-twiter only works for 3.5 # See more: https://github.com/bear/python-twitter # Apply filter and Crawl twits # Save filtered twits to the database - for annotation and analysis