Welcome to Tweetalytics! This is a tool for collecting and analyzing tweets.
2. Sign into Twitter Developers with your Twitter Account
3. Create a Twitter Application
4. Set the Access Level to "Read and write"
5. Create an Access Token
6. Install oauth
sudo gem i oauth
7. Install twurl
sudo gem i twurl
8. Begin the authorization of your Twitter account to make API requests
twurl authorize --consumer-key key --consumer-secret secret
-
key
is your application's consumer-key -
secret
is your application's consumer-secret
9. Enter the returned URL into your browser
10. Click "Authorize app"
11. Enter the returned PIN back into the terminal
To begin using this tool, make sure your current directory is the tweetalytics repository and type in the following command:
irb -r ./Run.rb
There are two ways to collect tweets: first, by specifying a bounding box, which is an array that consists of bottom-left-longitude, bottom-left-latitude, top-right-longitude, and top-right-latitude coordinates, and second, by specifying a certain keyword you want to track.
Use the collect function and specify how many tweets you want, the name of the file you will create, and a bounding box.
For example:
> collect(25, "tweets", United_States)
Use the collect function and specify how many tweets you want, the name of the file you will create, and the keyword.
For example:
> collect(25, "tweets", "obama")
The next thing to do is to load the tweets you just collected into Ruby.
For example:
> tweets = load("tweets")
Now process the tweets you just loaded in.
For example:
> processed_text = process(tweets)
or if you don't want to process the tweets:
> raw_text = get_raw_text(tweets)
Then analyze the tweets.
For example:
> character_statistics = character_analysis(raw_text)
For example:
> most_popular_words = top_words(5, processed_text)
- Use the post function and specify your tweet.
For example:
>>> post("Hello World!")
The MIT License (MIT)
Copyright (c) 2014 Paul Land
If you find any issues please report them or send a pull request.