Skip to content

Instantly share code, notes, and snippets.

@hotgazpacho
Created February 15, 2011 05:32
Show Gist options
  • Select an option

  • Save hotgazpacho/827133 to your computer and use it in GitHub Desktop.

Select an option

Save hotgazpacho/827133 to your computer and use it in GitHub Desktop.
Where are my twitter followers?
require 'yajl'
require 'twitter'
# Configure twitter
# Need to create an App with twitter first
# Your OAuth tokens can then be found by clicking "My Access Token"
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
# Get your follower's ids
follower_ids = Twitter.follower_ids.ids
# Get your followers, in groups of 100 (API restriction)
followers = Array.new
follower_ids.each_slice(100) {|ids| Twitter.users(ids) }.select {|follower| followers << follower}
# Get the unique locations for all your followers
locations = followers.select{|f| !f.location.nil? }.select{|f| !f.location.empty?}.collect{|f| f.location}.uniq.sort
@hotgazpacho

Copy link
Copy Markdown
Author

locations
[
[ 0] "28.273595,-82.688633",
[ 1] "33.77 -117.89",
[ 2] "37 N Orange Ave",
[ 3] "58.969946,5.733469",
[ 4] "59.307343,17.974293",
[ 5] "A build machine near you!",
[ 6] "Aarhus, Danmark",
[ 7] "Acton, MA 01720",
[ 8] "Acworth, GA",
[ 9] "Adelaide, Australia",
[ 10] "Akron, OH",
[ 11] "Akron, Ohio",
[ 12] "Alabama",
[ 13] "Alexandria, VA",
[ 14] "Amarillo, TX",
[ 15] "Amsterdam",
[ 16] "An amazon warehouse near you",
[ 17] "Ankeny, United States",
[ 18] "Arlington, VA",
[ 19] "Atlanta",
[ 20] "Atlanta, GA",
[ 21] "Atlanta, GA, US",
[ 22] "Atlanta, Ga.",
[ 23] "Auburn Hills, MI",
[ 24] "Aurora, IL",
[ 25] "Austin, TX",
[ 26] "Austin, Texas",
[ 27] "Australia",
[ 28] "Austria",
[ 29] "Avon Lake, OH",
[ 30] "Ballard, WA, USA",
[ 31] "Baltimore, MD",
[ 32] "Bangalore",
[ 33] "Bartow, FL",
[ 34] "Bay Area, CA",
[ 35] "Bayonet Point, FL",
[ 36] "Bedford, Mass.",
[ 37] "Beijing, China",
[ 38] "Berlin, Germany",
[ 39] "Bethlehem, MD.",
[ 40] "Beverly Hills, Florida",
[ 41] "Boise, ID",
[ 42] "Books, USA",
[ 43] "Boston, MA",
[ 44] "Boston, MA US",
[ 45] "Boulder, CO and Raleigh, NC",
[ 46] "Bourcherville",
[ 47] "Boyds, Washington",
[ 48] "Bradenton, FL",
[ 49] "Brasil",
[ 50] "Brisbane, Australia",
[ 51] "Bristol \342\200\242 Uk",
[ 52] "Bristol, IN US",
[ 53] "Bushnell, Florida",
[ 54] "C'ville, Virginia",
[ 55] "CO",
[ 56] "Cagayan de Oro, Philippines",
[ 57] "California",
[ 58] "Camberley, UK",
[ 59] "Camp Hill, PA, USA",
[ 60] "Canada",
[ 61] "Canada is my playground!",
[ 62] "Carolina, Puerto Rico",
[ 63] "Castle Rock, CO",
[ 64] "Cedar Rapids, IA",
[ 65] "Central Ohio",
[ 66] "Central Wisconsin",
[ 67] "Charlotte, NC",
[ 68] "Chattanooga, TN",
[ 69] "Chiang Mai, Thailand",
[ 70] "Chicago",
[ 71] "Chicago (Center of the World)",
[ 72] "Chicago, IL",
[ 73] "Chicago, IL (for now)",
[ 74] "Chicago, USA",
[ 75] "Christchurch, Dorset UK",
[ 76] "Christchurch, NZ",
[ 77] "Cincinnati, OH",
[ 78] "Cincinnati, Ohio",
[ 79] "Clearwater, FL",
[ 80] "Clearwater, Florida",
[ 81] "Clermont, FL",
[ 82] "Cleveland, OH",
[ 83] "Cleveland, Ohio",
[ 84] "Cloud",
[ 85] "Cochin",
[ 86] "Colorado",
[ 87] "Columbia, SC, USA",
[ 88] "Columbus, OH",
[ 89] "Columbus,Ohio",
[ 90] "Cooper City, FL",
[ 91] "Coventry",
[ 92] "Cranbury, NJ",
[ 93] "Crystal Lake, Illinois",
[ 94] "D.C. Metro",
[ 95] "Dallas, TX",
[ 96] "Dallas, Texas",
[ 97] "Dayton, OH",
[ 98] "Delaware, Ohio, USA",
[ 99] "Denver",
[100] "Denver, CO",
[101] "Des Moines, IA",
[102] "Detroit, Michigan",
[103] "Down South!!",
[104] "Downtown Lowell, MA, US",
[105] "Dusseldorf",
[106] "East Coast",
[107] "Edmonton, AB",
[108] "El Paso",
[109] "Ely, Cambridgeshire, UK",
[110] "Erlangen\n",
[111] "Essex UK",
[112] "Evergreen, CO",
[113] "Everywhere",
[114] "Fairfax, VA",
[115] "Farmington Hills, MI, US",
[116] "Farmington, MI",
[117] "Faroe Islands",
[118] "Finland",
[119] "Fishers, IN, USA",
[120] "Fiume Veneto (PN)",
[121] "Florida",
[122] "Florida ",
[123] "Fort Collins, CO",
[124] "Fort Lauderdale",
[125] "Fort Lauderdale, FL",
[126] "Fort Myers, Florida",
[127] "Fort Worth",
[128] "Fort Worth, TX",
[129] "Fort Worth, TX (aka Cowtown)",
[130] "France",
[131] "Franklin, TN",
[132] "Ft. Lauderdale, FL",
[133] "Gainesville/Miami",
[134] "Galloway, NJ",
[135] "Gardena",
[136] "Gilbert, Arizona",
[137] "Glasgow (Currently Seattle)",
[138] "Glasgow, UK",
[139] "Glendale, CA",
[140] "Global",
[141] "Grand Rapids, MI",
[142] "Greenville, SC",
[143] "Groton, CT",
[144] "Haarlem, NL",
[145] "Hagerstown, MD",
[146] "Hamilton, Canada",
[147] "Hattiesburg, MS",
[148] "Herzeliyya, Israel",
[149] "Highlands Ranch, Colorado",
[150] "Hoboken, NJ",
[151] "Hod Hasharon",
[152] "Hollywood, Fl",
[153] "Hong Kong, SAR",
[154] "Howell MI. ",
[155] "Huntsville, AL",
[156] "I'M working from home",
[157] "Idaho",
[158] "India",
[159] "Indianapolis",
[160] "Indianapolis, IN",
[161] "Inverness, FL, USA",
[162] "Istanbul, Turkey",
[163] "Itajub\303\241 - MG - Brazil",
[164] "Italy",
[165] "Jacksonville Beach, Florida",
[166] "Jacksonville, FL",
[167] "Jakarta",
[168] "Jamul, CA",
[169] "Ja\303\251n",
[170] "Juiz de Fora MG - Brasil",
[171] "Kansas City",
[172] "Karlsruhe, Germany",
[173] "Kells Irish Restaurant & Pub",
[174] "Kent, OH",
[175] "LA",
[176] "LISBON",
[177] "Lansing, Michigan",
[178] "Latvia",
[179] "Leeds, UK",
[180] "Lincoln, Lincolnshire, UK",
[181] "Link\303\266ping, Sweden",
[182] "Liverpool UK",
[183] "Liverpool, England",
[184] "London",
[185] "London, UK",
[186] "Long Island",
[187] "Long Island, NY",
[188] "Los Angeles",
[189] "Los Angeles, CA",
[190] "Los Angeles, Tokyo, Manila",
[191] "Lost, Maryland",
[192] "MA, USA",
[193] "MD",
[194] "Madison, AL",
[195] "Madrid",
[196] "Malaga, Spain",
[197] "Malaysia",
[198] "Malm\303\266",
[199] "Manchester",
[200] "Manchester, NH",
[201] "Marquette, MI",
[202] "Massachusetts",
[203] "Mechelen, Belgium",
[204] "Melbourne, Australia",
[205] "Melbourne, Florida",
[206] "Memphis, TN",
[207] "Merriam, KS",
[208] "Mexico",
[209] "Miami, FL",
[210] "Miami,Florida Fl usa",
[211] "Michigan",
[212] "Midwest, Plains, SE, NE",
[213] "Milan, Italy",
[214] "Milwaukee, WI USA",
[215] "Minneapolis",
[216] "Minsk, Belarus",
[217] "Mission, BC, Canada",
[218] "Missoula, MT",
[219] "Moneyapolis, MN",
[220] "Mountain View, CA",
[221] "Mty MX",
[222] "Mumbai, India",
[223] "NY",
[224] "NYC or right behind you. ",
[225] "Naples, FL",
[226] "Nashville, TN",
[227] "Nevada",
[228] "New Jersey ~ NJ \342\234\210 Memphis TN",
[229] "New Orleans, LA",
[230] "New Paltz, NY",
[231] "New Port Richey, FL, USA",
[232] "New York",
[233] "New Zealand",
[234] "North Carolina",
[235] "Northampton, MA USA",
[236] "Norway",
[237] "Notre Dame, IN",
[238] "Novi Sad, Serbia",
[239] "Nr. Marbella, Spain",
[240] "OH",
[241] "Oakland, CA",
[242] "Ocala, Florida",
[243] "Ocean Springs, MS",
[244] "Okemos, Michigan 48864",
[245] "Omnipresent",
[246] "Ontario, CAN",
[247] "Orange, TX, USA",
[248] "Oregon",
[249] "Orlando",
[250] "Orlando, FL",
[251] "Orlando, Fl",
[252] "Oslo",
[253] "Ottawa, ON, Canada",
[254] "PACIFIC NORTHWEST",
[255] "Pacific Northwest, USA",
[256] "Palo Alto, CA",
[257] "Paraguay, but I live online",
[258] "Paris, France",
[259] "Penarth, Wales",
[260] "Pennsylvania",
[261] "Peoria, IL",
[262] "Perth, Western Australia",
[263] "Philippines",
[264] "Phoenix some of the time",
[265] "Phoenix, Arizona",
[266] "Pinckney, MI",
[267] "Pineberry St",
[268] "Pittsburgh, PA",
[269] "Pomona",
[270] "Poole, Uk",
[271] "Port St. Joe, FL",
[272] "Portland, OR",
[273] "Porto Alegre - Brasil",
[274] "Porto, Portugal",
[275] "Portugal",
[276] "Prague, Czech Republic",
[277] "Pueblo, CO",
[278] "Pune, India",
[279] "Punjab, India",
[280] "Reading, UK",
[281] "Redmond",
[282] "Redmond, WA",
[283] "Richmond VA",
[284] "Richmond, London, UK",
[285] "Richmond, VA",
[286] "Right behind you!!!",
[287] "Riverview, FL",
[288] "Rochester NY",
[289] "Roswell, GA",
[290] "Sailing the Seas of Cheese",
[291] "Saint Louis, MO",
[292] "Saint Paul, MN",
[293] "Salt Lake City, UT",
[294] "San Antonio, TX",
[295] "San Diego",
[296] "San Francisco",
[297] "San Francisco / Am\303\251rica Latina",
[298] "San Francisco Bay Area",
[299] "San Francisco, CA",
[300] "San Mateo, CA",
[301] "Santa Ana\tCalifornia",
[302] "Sarasota, FL",
[303] "Scottsdale, AZ",
[304] "Seattle, WA",
[305] "Sebastopol, CA",
[306] "Secret volcano lair",
[307] "Shanghai",
[308] "Sheffield, UK",
[309] "Shepherdstown, WV",
[310] "Sibiu, Romania",
[311] "Silicon Valley",
[312] "Silicon Valley, CA",
[313] "Singapore",
[314] "Slater, IA",
[315] "SoCal, IE",
[316] "South Jersey",
[317] "Southwest Florida",
[318] "Space Coast, Florida",
[319] "Spain",
[320] "St Petersburg",
[321] "St Petersburg, FL, USA",
[322] "St. Louis, MO",
[323] "St. Pete/Tampa, FL",
[324] "St. Petersburg Fl.",
[325] "St. Petersburg, FL",
[326] "St. Petersburg, FL USA",
[327] "St.Petersburg, Russia",
[328] "Stamford, UK",
[329] "Sydney",
[330] "Sydney, Australia",
[331] "TAMPA FLORIDA",
[332] "Taiwan ",
[333] "Tallahassee, FL",
[334] "Tampa Bay",
[335] "Tampa Bay Area, FL",
[336] "Tampa Bay Florida",
[337] "Tampa Bay, FL",
[338] "Tampa Bay, Florida",
[339] "Tampa FL",
[340] "Tampa Florida",
[341] "Tampa, FL",
[342] "Tampa, FL (KForce Office)",
[343] "Tampa, Fl",
[344] "Tampa, Florida",
[345] "Tauranga, NZ",
[346] "Thailand",
[347] "The .NET CLR and DLR",
[348] "The Airport",
[349] "The Social Solar System",
[350] "The Sunshine State",
[351] "The Tubes",
[352] "The cloud; Connecticut",
[353] "Tijuana",
[354] "Topeka, KS",
[355] "Toronto",
[356] "Toronto, Canada",
[357] "Toronto, ON",
[358] "Toronto, Ontario",
[359] "Trondheim",
[360] "Trondheim, Norway",
[361] "Tucson, AZ, US",
[362] "Tulsa, OK",
[363] "Tupelo, MS",
[364] "Twitterverse",
[365] "UK",
[366] "UK (London & Swansea)",
[367] "US",
[368] "USA",
[369] "Udon Thani, Thailand",
[370] "United Internetdom (Louth, UK)",
[371] "United Kingdom",
[372] "United States",
[373] "Unknown",
[374] "Upstate, SC",
[375] "Vancouver, BC",
[376] "Varies, mostly Scotland",
[377] "Vegas",
[378] "Vitoria-Gasteiz",
[379] "V\303\244ster\303\245s, Sweden",
[380] "Waco, TX",
[381] "Wadsworth, OH, USA",
[382] "Washington, D.C.",
[383] "Washington, DC",
[384] "Webster newyork!!! ",
[385] "Wellington, New Zealand",
[386] "West Chester, PA",
[387] "West Melbourne, FL",
[388] "Where the wild things grow",
[389] "Wherever .NET developers are",
[390] "Wherever Rubyists need shirts.",
[391] "Winchester",
[392] "Winchester, UK",
[393] "Winchester, UK | Madrid, ES",
[394] "Windermere, Florida",
[395] "Winnipeg",
[396] "Winter Haven, Florida, United ",
[397] "Wisconsin",
[398] "Wodonga, Victoria",
[399] "Worldwide",
[400] "Yesod",
[401] "York, PA",
[402] "York, UK",
[403] "Yorkshire, UK",
[404] "at home",
[405] "chennai",
[406] "contra costa,ca",
[407] "dallas, TX",
[408] "denver",
[409] "florida",
[410] "iPhone: 28.107101,-82.636780",
[411] "iPhone: 35.953320,-84.161926",
[412] "iPhone: 38.986805,-77.097736",
[413] "iPhone: 38.988155,-77.098114",
[414] "iPhone: 39.100662,-84.507584",
[415] "iPhone: 41.417072,-81.901932",
[416] "iPhone: 51.398949,-0.298982",
[417] "indonesia",
[418] "jacksonville, fl",
[419] "las vegas nv",
[420] "miami",
[421] "portugal",
[422] "spring hill florida",
[423] "taiwan",
[424] "twitter",
[425] "u.s.a.",
[426] "uk",
[427] "us",
[428] "usa",
[429] "viet nam",
[430] "worcester, ma",
[431] "www.2020architect.org",
[432] "\303\234T: -31.39488,-64.173914",
[433] "\303\234T: -7.23803,112.778395",
[434] "\303\234T: -7.319661,112.764906",
[435] "\303\234T: 27.918145,-82.506044",
[436] "\303\234T: 28.132343,-82.37462",
[437] "\303\234T: 29.864869,-82.607537",
[438] "\303\234T: 36.036206,-79.392685",
[439] "\303\234T: 40.002139,-82.917652",
[440] "\303\234T: 40.618146,-74.128686",
[441] "\303\234T: 41.373155,2.159025",
[442] "\303\234T: 41.538958,-81.527089",
[443] "\303\234T: 42.043707,-91.68387",
[444] "\303\234T: 43.67063,-114.36608",
[445] "\303\234T: 47.435413,-122.307977",
[446] "\342\230\201 Atlanta | Los Angeles \342\230\201",
[447] "\345\214\227\346\265\267\351\201\223"
]

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