Skip to content

yookd/tweet_frequency

Repository files navigation

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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages