Extract each Location from Stargazers in the Github repository

The Chef plugin I publish as OSS, knife-zero, has 76 stars. Most of the Stargazers have nothing to do with it, though it may not be a lot of them. Moreover, I feel that there are many foreign countries these days.

I found it rather interesting that we didn't know each other's horse bones, so I wanted to confirm the location.

Write in Python

The module used is github3.py, and Python is 2.7.10.

sg.py


import os
from github3 import login

##If you don't use tokens, you will soon get caught in the API limit.
gh = login(token=os.environ['GH_TOKEN'])
repo = gh.repository('higanworks', 'knife-zero')

## iter_stargazers()Returns User in the form of an iterator.
for x in repo.iter_stargazers():
    print x, gh.user(x).location

I ran it and tried to extract the location

After all, the notation is disjointed and painful w

$ python ./sg.py 
tkuchiki None
libero18 Japan
DQNEO Japan
mohitsethi None
marcy-terui Sapporo City, Hokkaido, Japan
kimikimi714 None
tkak Tokyo
MasahiroSakoda Kanagawa Pref. Japan
takus Japan
kwilczynski Tokyo, Japan
nabeken Tokyo, Japan
deeeki Japan
bageljp Tokyo, Japan
shigeya Tokyo, Japan
blp1526 Tokyo
cl-lab-k Japan
knakayama Japan
wslash Japan
linyows FuckOka, Japan
SlyDen Lviv, Ukraine
eigo-s None
threetreeslight Tokyo
y13i Tokyo, Japan
bangbangshoot None
fprg None
sanemat Tokyo, Japan
fumikony None
dataferret Halifax, Canada
ikuwow Japan
rmoriz Munich, Germany
arosenhagen Darmstadt
sakazuki Tokyo, Japan
9gel None
teragino None
ispern Kagoshima
torounit Matsumoto, Nagano, Japan
Gascar-ShunT Tokyo
imura81gt None
cblunt Devon, UK
yukimamire None
gregf Maine
Azulinho Bristol
paulmoon None
inokappa None
ChrisLundquist Seattle, Wa
takeharu Tokyo
antage Russia
Chirul0 None
mitto Yokohama
runningman84 None
ssdns None
kyle-johnson Seattle, WA
ryandjurovich Melbourne, Australia
rollbrettler Berlin
adampats None
hirak Tokyo
patcon Waffles
k-nii0211 Tokyo
sawanoboly Kobe, Japan
ghempton Seattle, WA
mrjcleaver Toronto, ON, Canada
yukihariguchi None
hsbt Tokyo, Japan
azet *
k-yamada japan
daften Gent
pwelch Silver Spring, MD
dalpo Italy
h4ck3rm1k3 Hopewell, NJ
gretel Hamburg, Germany
expvictordamian None
guiferrpereira Porto
andrefreitas Porto and Madeira, Portugal
ruimashita None
caleb Rochester, NY
4148 Berkeley, CA

It was confirmed that it was 1/3 that it was not Japan (excluding Japan, Tokyo, None). Except for Africa and Antarctica, it comes all together.

The one who was most surprised was the one from ** FuckOka **, Japan.

Recommended Posts

Extract each Location from Stargazers in the Github repository
Extract each Location from Stargazers in the Github repository
Install github repository with pip
Pip install the GitHub repository
Github Interesting Repository ⓪ Table of Contents
Include "%" in argparse help to die
Pip install the GitHub repository
Extract text from images in Python
Extract strings from files in Python
Clone the github repository on jupyter notebook
Password management technology in the GitHub era
Script to use multiple github accounts properly in the same repository on the same machine
Use PIL in Python to extract only the data you want from Exif
Extract only the file name excluding the directory in the directory
Match the distribution of each group in Python
[Automation] Extract the table in PDF with Python
Extract only complete from the result of Trinity
pip install Specify the github repository as the source
How to clone github remote repository from atom
Access the variables defined in the script from the REPL
[Scrapy] Extract batting results for each player from the professional baseball game information site
Obtain location information (latitude and longitude) from the address. Geocode in Python ~ Geocoder and pydams ~