Skip to content

Instantly share code, notes, and snippets.

@berkes
Created July 28, 2010 10:31
Show Gist options
  • Save berkes/493984 to your computer and use it in GitHub Desktop.
Save berkes/493984 to your computer and use it in GitHub Desktop.
Auto Unfollow people who update twitter from foursquare
# 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
@berkes
Copy link
Author

berkes commented Jul 28, 2010

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment