Skip to content
No description or website provided.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.rspec
Gemfile
Gemfile.lock
README.md
tweet_frequency-0.0.0.gem
tweet_frequency-0.0.1.gem
tweet_frequency-0.0.2.gem
tweet_frequency-0.0.3.gem
tweet_frequency.gemspec

README.md

TweetFrequency (version 0.0.3)

Print out the most frequently used words in the last 1000 (or less) tweets.

  • Contractions count as two words: don't: don and t.
  • Output has been downcased.
  • I used my own OAuth keys and access tokens so continuous use might throw a rate-limit error.
  • You can't access protected tweets so it will throw a TweetFrequency::ProtectedUser error.

Setup

Install the gem:

gem install tweet_frequency

Open up irb:

irb

Add the gem:

> require 'tweet_frequency'

Use

Specify a user e.g. 'jack':

> user = TweetFrequency::User.new('jack')

Find out the most frequently used words in the last 1000 tweets:

> user.word_frequency

You can pass arguments to the call now. Note that these are the only options that are available right now:

> options = {
>   include_rts: true,
>   exclude_replies: true
> }
>
> user.word_frequency(options)

Example Output

Jack Dorsey (@jack) has 12158 tweets. Here are his/her most frequently used words in the last 1000 tweets: 

http (454)
the (417)
rt (338)
to (286)
and (192)
a (191)
...

Conclusion

This was the first gem I ever made and I must say the experience has been extremely rewarding. Thank you for exposing me to this!

Something went wrong with that request. Please try again.