github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

phillipoertel / all_tweets_must_die

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (1)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (1)
    • v0.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

This library kills your twitter messages once they are over a certain age. — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Fixed indentation. 
phillipoertel (author)
Tue Jun 30 16:09:32 -0700 2009
commit  d82fc804b5d073b8ddfa1d03b232a50826ce6ee1
tree    8621620f9b98cb30042de56c53e3cabe6a27a844
parent  8f88c9299faed224c7899721d64b980ea6b0f59e
all_tweets_must_die /
name age
history
message
file .gitignore Loading commit data...
file CHANGELOG.markdown
file README.markdown
file Rakefile
file VERSION.yml
file all_tweets_must_die.gemspec
directory dsl/
directory examples/
directory lib/
directory test/
README.markdown

Introduction

Hi there!

This library kills twitter messages of a given user once they are older than a certain age.

The default TweetHandler will delete all tweets older than 12 hours, which can be modified by adding a hashtag like #keep24h (keeps it 24 hours) or just #keep (doesn't delete tweet at all) to the tweet.

The library also lets you write custom TweetHandlers, so it you can do whatever you want with the tweets on your timeline. Examples: automatically blogging all your tweets tagged with #blog, doing something else with the hashtag #quote, and so on. See dsl/handlers.rb for how this works.

Then use rake run:dsl to execute the handlers on your timeline.

Warning

  • I'm happy if you find this code useful, this is a private project though and it changes regularly. Use at your own risk.
  • Only 20 tweets are loaded from your timeline (this is the twitter API default). Until I add a setter, this can be hacked in Runner#fetch_tweets.
  • When running periodically, it does not remember which tweets were already processed. So tweets will be processed again in the next run, if if you don't delete tweets after processing.

Usage

run one of the rake run-tasks once or repeatedly with cron. see examples/crontab. Type rake -T run to see what's available.

Installation

To use the rake tasks, create a file called login.rb in the root and add

@login = {

:user     => 'your_twitter_username',
:password => 'your_twitter_password'

}

if you want to use rake deploy, add the following to login.rb (requires rsync and ssh access)

@rsync_upload_uri = 'ssh-username@servername:/directory/on/server'

Implementation overview

The rake task starts the Runner with a username and loads all tweets. Each tweet is loaded into a Tweet instance and then all the registered TweetHandlers are asked if they want to do anything with the tweet.

TODOS

  • clean up DSL and make it more flexible (need to read a bit)
  • rewrite the original #keep-handlers to be DSL-based instead of code-based, then throw out the add_handler method
  • fix gem (require problem)
  • require all needed files centrally, fixing the somewhat hacky requiring everywhere (what's the common ruby practise?)
  • put configuration into yaml file and also allow loading it from shell environment variables
  • use oauth
  • write more handlers
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server