Created
May 10, 2014 07:41
-
-
Save ssaunier/1476f1cb460f0144c669 to your computer and use it in GitHub Desktop.
FrenchTech cities
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 'yaml' | |
require "octokit" | |
client = Octokit::Client.new :access_token => `cat ~/.gist` | |
results = {} | |
# Cities from http://fr.wikipedia.org/wiki/Liste_des_communes_de_France_les_plus_peupl%C3%A9es | |
cities = File.readlines("cities.txt") | |
cities.each do |city| | |
query = client.search_users("location:\"#{city}\"") | |
results[city] = query[:total_count] | |
puts "Found #{query[:total_count]} developers in #{city}" | |
sleep 2 | |
puts "Remaining queries: #{client.rate_limit.remaining}, resets in #{client.rate_limit.resets_in}s" | |
end | |
File.open('cities_result.yml', 'w') do |f| | |
f.write results.to_yaml | |
end |
Suite et fin de l'étude, en prenant en compte les agglomérations :
http://sebastien.saunier.me/blog/2014/05/13/classement-technologique-des-villes-francaises.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
même si la méthode est empirique (et portera forcément une marge d'erreur non négligeable), je trouve que c'est une hyper-idée.
Merci.