Skip to content

Instantly share code, notes, and snippets.

@harrisj
Created March 29, 2013 00:58
Show Gist options
  • Save harrisj/5268042 to your computer and use it in GitHub Desktop.
Save harrisj/5268042 to your computer and use it in GitHub Desktop.
Using Twitter as a Content Filtering Interface
One random idea I have been kicking around with in the past is using Twitter as a crowdsourced moderation interface. This is an interesting approach in the following cases:
1. We receive many more potential items than we want to appear on the official, moderated interface.
2. The moderation twitter account is an interesting behind-the-scenes stream for people who are really interested in the content we are moderating down for the final site.
The final site could be another twitter account that posts only the best or anything else really (blog, tumblr, facebook, pinterest, what have you).
This approach won't really work well if you want to filter out questionable content. It's not an obscenity filter but merely a fun way of separating out the most popular items from the stream. How does it work?
For each item you post to the firehose twitter account, you store the following information in your DB:
:tweet_id, :string
:tweeted_at, :datetime
:retweet_count, :integer, :default => 0, :null => false
:favorite_count, :integer, :default => 0, :null => false
:post_to_main_blog, :boolean, :default => false, :null => false
Then, your script posts to twitter. We could consider a post moderated to go to the "best-of" set if it meets any of the following criteria:
1. More than M faves (eg, the favorite_count in the twitter API)
2. More than N retweets (from the retweet_count in the twitter API)
3. Favorited by one of a special moderator accounts (nothing in the twitter API)
Unfortunately, the twitter API does not allow you to look who has faved a tweet (even though it's provided on the detail page for a tweet). Only recently, they just added a favorite_count to tweets returned in the API, so it might take a while.
As for checking tweets, there are two possible options:
1. Check each tweet individually (up to 24 or 48 hours after it's posted). Specific, but it might run into API limits
2. Just grab the user_timeline for the twitter account and update the counts for all the tweets mentioned in there. Might limit your lookback interval with a high-volume of tweets, but better with API limits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment