/raspberry-tweet

Routines to use twitter from raspberry

Primary LanguageRubyGNU General Public License v2.0GPL-2.0

raspberry-tweet

Routines to use twitter from raspberry

You can use twitter from your Raspberry Pi implementing one or more cronjobs

Requeriments

  • Ruby version >= 1.9.3
  • Rubygems
  • bundler(may need to be root): gem install bundler
  • Some coffee

How to set up?

  • First sign up at http://dev.twitter.com and create a aplication

  • Now can use your consumer key, consumer secret, access token as oauth_token and access token secret as oauth_token_secret for config the file "config/config.rb"

  • Get the root folder should be called "raspberry-tweet" and run the command

bundle install
  • Creates a MySQL database and configures the file "config/database.yml"

  • Now create migrations with

rake db:create
rake db:migrate
  • Enjoy

How to user?

  • Say the current time
ruby tells_time.rb
  • Post a note from google news
ruby news.rb
  • Do some re-tweet related to raspberry
ruby retweet.rb
  • Say hello to new followers
ruby followers.rb

Example

Make a crontab that say hello every 45 minutes and record the output in the file log-followers.log.

Assuming that your folder is inside /home/pi

  • Edit the file containing instructions crontab
crontab -e
  • Enter the following line at end of file
45 * * * * ruby /home/pi/raspberry-tweet/followers.rb >> /home/pi/log-followers.log 2>&1

To save press CTRL + O and then ENTER

  • Now, execute
crontab -l

you should see something like the following

....
45 * * * * ruby /home/pi/raspberry-tweet/followers.rb >> /home/pi/log-followers.log 2>&1