Skip to content

simple twitter agent to help us in making the Data set

Notifications You must be signed in to change notification settings

we-have-no-name/TwitterAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TwitterAgent

simple twitter agent to help collect tweets for our Data set

Requirements

you need to make a simple config.json file with this structure
those credentials can be optained after creating an app in https://apps.twitter.com

{
	"consumer_key": "",
	"consumer_secret": "",

	"access_token":"",
	"access_token_secret":""
}

and pass it to the TwitterAgent object

agent = TwitterAgent("config.json")

Example usage

import TwitterAgent
agent = TwitterAgent.TwitterAgent()
# get a sample stream of tweets
agent.get_sample_tweets_stream()
# search for tweets with specific keywords
agent.search_for_tweets_with_keywords(['play'], num_per_keyword=100)
# get stream data with specific keywords (emoji)
agent.get_tweets_stream_with_keywords(['\U0001F602'])
# get stream data with specific keywords (multiple keywords)
agent.get_tweets_stream_with_keywords(['the are'])

About

simple twitter agent to help us in making the Data set

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages