Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Mini app that processes new followers notifications from Twitter
JavaScript Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
public
views TweetBlocker is down
.gitignore
Capfile
Gemfile
Gemfile.lock
README.md
Rakefile
app.rb
app_spec.rb
config.ru
config.yml
models.rb update email parsing
test_email_payload.yml

README.md

Twitter followers app

This web app (screenshot) processes incoming "{Person} is now following you on Twitter" emails from Twitter. It saves info about the user who follows you and shows a queue of new followers so you can decide which ones to block. It also gives you an Atom feed of your new followers.

Configuration

See "config.yml". Either use environment variables, or create a "config.local.yml" (ignored from version control) where you can selectively override values for the machine where the app is running.

Incoming email configuration

I forward my Twitter email notifications from my main email account to an address such as mislav@example.com. On the server for this domain, I configure postfix to save each email in a separate file and Astrotrain to process them and send them to this app via HTTP POST.

The POST should be to the root URL ("/") and should contain the HTML part of the email in the html parameter and email headers in parameters such as headers[x-twitterrecipientscreenname]=mislav. This parameter scheme is the default in Astrotrain, so no extra configuration is necessary.

In "/etc/postfix/main.cf":

myorigin = /etc/mailname
mydestination = example.com, localhost.localdomain, localhost

# the trailing slash is important here!
# see man local(8) under "MAILBOX DELIVERY"
mail_spool_directory = /var/mail/

Then, in Astrotrain "config.rb":

Astrotrain::Message.queue_path = "/var/mail/mislav/new"
Astrotrain::Message.archive_path = File.join(Astrotrain.root, 'archive')
Something went wrong with that request. Please try again.