Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib Make sure output is sorted
spec
.rspec
Gemfile
Gemfile.lock Update gemfile
README.md
tweet_frequency-0.0.0.gem Remove Twitter config file, add newest gem build
tweet_frequency-0.0.1.gem Update gem
tweet_frequency-0.0.2.gem Update the README file (options). Push gem to RubyGems
tweet_frequency-0.0.3.gem Update the README file (options). Push gem to RubyGems
tweet_frequency.gemspec Update the README file (options). Push gem to RubyGems

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.