Class Index [+]

Quicksearch

twitter_alert

The problem that twitter_alert attempts to solve is the programmatic sending of DMs to all the followers of a given Twitter account. It is a simple gem that provides one Class and one Module. The class is TwitterAlert::Account and represents the Twitter account you want to make announcements from. The Module is TwitterAlert::Alert and should be mixed in to a class that you want to represent the messages themselves.

DISCLAIMER: Please, please, please don’t use this gem to spam people. If you do, I hope you get unfollowed or blocked. Seriously. Get permission. Make sure your followers know that by following your account they’re signing up to get DMs from a machine.

Installing

To install, simple:

  sudo gem install twitter_alert

Note: This gem depends on Grackle for Twitter access.

Getting Started

The most basic case is pretty simple and would look something like this:

  require 'twitter_alert'

  account = TwitterAlert::Account.new :user_name => 'benhamill', :password => 'thisisnotmyrealpassword'

  class Alert
    include TiwtterAlert::Alert
  end

  alert = Alert.new 'Very important message.', DateTime.now

  account.announce alert

In a real program, I’d expect that your Alert class would actually be somewhat more complicated and probably inherit from ActiveRecord or something. The way I intend to use this is to set up a cron job to pull messages out of the DB that are marked for a given day and send them.

Note on Patches/Pull Requests

This is the standard Jeweler procedure.

Copyright

Copyright © 2009 Ben Hamill. See LICENSE for details.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.