Created
July 28, 2010 10:31
-
-
Save berkes/493984 to your computer and use it in GitHub Desktop.
Auto Unfollow people who update twitter from foursquare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gem by John Nunemaker http://twitter.rubyforge.org/ | http://github.com/jnunemaker/twitter | |
require 'twitter' | |
# yea, I know, should be oauth, but hey, this is just a script you run locally. So, whatever. | |
httpauth = Twitter::HTTPAuth.new('username', 'pasword') | |
client = Twitter::Base.new(httpauth) | |
# This selects only twenty last tweets. Play with the query for | |
# http://rdoc.info/rdoc/jnunemaker/twitter/blob/d2432da5a54fc9b788258ff9adfc93b379624957/Twitter/Base.html#friends_timeline-instance_method to receive more tweets | |
foursquares = client.friends_timeline.select {|t| t.source =~ /foursquare\.com/ } | |
foursquares.each do |fsq| | |
client.friendship_destroy(fsq.user.id) | |
#You may want to send that user a reply | |
client.update("@#{fsq.user.screen_name} I don't like you littering my timeline with foursqaure thingies. And unfollowed you. #nananana", { in_reply_to_status_id => fsq.id }) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
oh. And also. This is a Joke. Eventhough I really do dislike foursquare a lot, and eventhough I do unfollow people who foursquare me, by hand most often, the fact that I wrote a li'l script for it, is not an attack on all the happy foursquare folks out there. It is a joke. Hahaha.