Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Showing with 55 additions and 43 deletions.
  1. +55 −0 follow_cocoaheads.rb
  2. +0 −43 follow_iphone_devs.rb
View
55 follow_cocoaheads.rb
@@ -0,0 +1,55 @@
+# Follow everyone who filled in his twitter on the cocoaheads twitter page
+# If you're already following someone it won't follow him again
+# 1. Plug in your google and twitter account details below
+# 2. Run it
+# 3. See you in Ghent !
+# http://cocoaheads.be/wordpress/2009/09/cocoaheads-belgium-enthousiasts-on-twitter/
+# You'll need the google spreadsheet gem (http://github.com/gimite/google-spreadsheet-ruby/tree/master) and the twitter gem
+
+
+require "rubygems"
+require "google_spreadsheet"
+require 'twitter'
+require 'activesupport'
+
+google_user = "xxxxxxxxxx"
+google_pw = "xxxxxxxxxx"
+twitter_user = "xxxxxxxxxx"
+twitter_pw = "xxxxxxxxxx"
+# set it as you like
+open_url_in_safari = true
+follow_on_twitter = false
+session = GoogleSpreadsheet.login(google_user, google_pw)
+
+ws = session.spreadsheet_by_key("0AnofOeVdrQL-dG9DdksyWWM0dFMxdDlMUUU0SlZNWkE").worksheets[0]
+
+# Not even thinking of doing oauth…
+httpauth = Twitter::HTTPAuth.new(twitter_user, twitter_pw)
+client = Twitter::Base.new(httpauth)
+
+# Skip the header
+for row in 2..ws.num_rows
+ fullname = ws[row,1]
+ user = ws[row,2]
+ url = ws[row,3]
+ user.tr!("@","")
+ if follow_on_twitter
+ # As seen on http://blog.10to1.be/rails/2009/08/14/present/
+ # But I did have to require activesupport for it to work
+ if user.present?
+ puts "Attempting to follow #{fullname} (@#{user})"
+ begin
+ client.friendship_create(user)
+ puts "success"
+ rescue
+ puts "******* Failed #{$!.message}"
+ end
+ else
+ puts "Can't find twitter for #{fullname}"
+ end
+ end
+
+ if url.present? and open_url_in_safari
+ `open -a safari #{url}`
+ end
+end
View
43 follow_iphone_devs.rb
@@ -1,43 +0,0 @@
-# This script is designed to read the list of users here: http://spreadsheets.google.com/ccc?key=pA2sIvlHaiZUVkzPjkZ7Dcg and follow them with your twitter account.
-#
-# Plug in your Google and Twitter account details below.
-#
-# Credit for this script goes to David Clements.
-# http://shortpath.blogspot.com/2009/01/follow-over-100-iphone-developers-on.html
-#
-# IMPORTANT NOTE:
-# You'll need the Google Spreadsheet gem (http://github.com/gimite/google-spreadsheet-ruby/tree/master) and the Twitter gem
-
-# You may want to change the 1..1000 below so it only adds 10 followers at a time (every hour or so).
-# Twitter will like you more then.
-
-require "rubygems"
-require "google_spreadsheet"
-require 'twitter'
-
-google_user = "XXXXXXXX"
-google_pw = "XXXXXX"
-twitter_user = "XXXXXXX"
-twitter_pw = "XXXXXXX"
-
-session = GoogleSpreadsheet.login(google_user, google_pw)
-
-ws = session.spreadsheet_by_key("pA2sIvlHaiZUVkzPjkZ7Dcg").worksheets[0]
-
-base = Twitter::Base.new(twitter_user, twitter_pw)
-
-(1..1000).each do |row|
- url = ws[row,2]
- matched_user = url.match(/http:\/\/twitter.com\/(.*)/)
- next unless matched_user
- matched_user = matched_user[1]
-
- puts "Attmepting to follow #{matched_user}"
-
- begin
- base.create_friendship(matched_user)
- puts "success"
- rescue
- puts "******* Failed #{$!.message}"
- end
-end

No commit comments for this range

Something went wrong with that request. Please try again.