Created
April 27, 2013 16:12
-
-
Save amscotti/5473624 to your computer and use it in GitHub Desktop.
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
| require "rubygems" | |
| require "twitter" | |
| require 'geokit' | |
| username = "amscotti" | |
| friends_list = Twitter.friends(username) | |
| friends_list.users.each do |friend| | |
| puts "----------------------------" | |
| unless friend.location.nil? || friend.location.strip.empty? | |
| puts "#{friend.name} AKA #{friend.screen_name} is from #{friend.location}" | |
| geo = Geokit::Geocoders::YahooGeocoder.geocode(friend.location) | |
| puts geo.success ? "#{geo.lat}, #{geo.lng}" : "Unable to find Geo for #{friend.location}" | |
| else | |
| puts "#{friend.name} AKA #{friend.screen_name} idk where they are from..." | |
| puts "No listed location" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment