

Show HN: A graph of the languages you use on Github - aaronpk
http://aaronparecki.com/github-language-graph/

======
alpb
That's pretty inaccurate. So I forked Linux kernel and changed nothing. Now
I'm a 99.9% C developer. Cool.

------
infincia
I was a bit shocked to see numbers like this: <http://i.imgur.com/2ayTD.png>

But then I realized there are a ton of libraries included in some of those
repos, so for languages or platforms where it's common to include 3rd party
libraries in the tree (obj-c is a big one, appengine too and i hit both :),
you'll get all that stuff counted by the github API too.

Nice little tool though, good work :)

------
tzs
How is it counting? For me (tzs on Github) it says I have this many lines:

    
    
        2038 JavaScript
       43274 Lua
       17425 Perl
    

If I count up the heads of all my repositories, just going by lines in the
file to maximize the counts (i.e., not filtering out whitespace or comments,
and counting mixed HTML/JavaScript as all JavaScript) I get numbers more like
this:

    
    
       1000 JavaScript
       1100 Lua
        600 Perl

~~~
aaronpk
My mistake!

Apparently the counts that come back from the Github api are bytes, not lines.
<http://developer.github.com/v3/repos/#list-languages>

You can see an example of an API call for one of your repositories:
[https://api.github.com/repos/tzs/Reddit-Math-Display-for-
Saf...](https://api.github.com/repos/tzs/Reddit-Math-Display-for-
Safari/languages)

~~~
xyzzyb
This is one instance where the github documentation is lacking. Actually their
entire API documentation site could use some serious attention.

------
kibwen
For a fun time, check out some of the statistics for large organizations with
Github accounts (e.g. Joyent, Mozilla), or simply bask in the monochromatic
majesty of Torvalds.

Does anyone know where the source for this data is? I was poking around in
Github's API for this sort of thing just last week, with no luck.

~~~
xyzzyb
It's making a couple of calls: 1) grab the list of repos for the given user,
2) use the "List languages" call to the github repo API to pull in the
language data for each repo.

<http://developer.github.com/v3/repos/>

------
samirahmed
This is really neat.

One suggestion would be to have a visible and accessible back button or search
again button.

Since going back doesn't take you to the home screen, I need to refresh to get
back to the search option

~~~
aaronpk
Thanks for the suggestion! I added a "start over" button.

~~~
caseorganic
Thanks! I wanted to request that too.

------
gukjoon
Very neat. How does this treat forks? Does it consider only the commits you
make?

~~~
aaronpk
Unfortunately it counts all code on your account equally. Github has a nice
API that returns byte-count per language for a repository:
[https://api.github.com/repos/aaronpk/Flickr-
Archiver/languag...](https://api.github.com/repos/aaronpk/Flickr-
Archiver/languages) I was thinking about excluding forks, or showing them in a
separate graph.

~~~
strager
I'd like that. My forks of a few C++ projects brings C++ to over 50%, but I
barely use C++ in my own projects. =]

------
th0ma5
I got different results each time, not in the numbers, but in the rendering of
the graph. Anyway for a permalink or somesuch that I can send to people?
Otherwise rather nice! :D

~~~
aaronpk
Yea I was thinking about making a permalink for it, but it's implemented
entirely client-side so I don't think I have an easy way to do that. Feel free
to fork it on github if you can figure it out:
<https://github.com/aaronpk/Github-Language-Graph>

~~~
jawngee
I sent you a pull request that uses hash tags.

~~~
aaronpk
Awesome! Merged it in and updated the site. Thanks!

------
alptrv
Cool. But I assume it only looks to user's public repositories? Would be nice
to see a graph with private repos. Don't know if it would be possible with
Github's API

~~~
aaronpk
Yes, it only looks at public repositories. It wouldn't be hard to look at
private ones but it would require the user to OAuth so the app has access. But
I'm not sure if Github supports using OAuth entirely in Javascript (like
<https://developers.geoloqi.com/client-libraries/Javascript>) so then it would
require a server-side backend to handle the login.

------
ohyes
Language Bytes

Clojure 6731

JavaScript 9778

Erlang 13858

Common Lisp 584550

Emacs Lisp 2489

What do I win Bob??

------
kingkilr
So yeah, code.

    
    
      Python	7308374
      JavaScript	1247179
      Shell		12761
      C		5939

~~~
mkramlich
I like your taste in languages. That mix will realistically let you do 99% of
the things you'd want, almost all roles and use cases, well. Not a
coincidence, that's the mix I've settled on too. :)

------
willvarfar
Neat looking but I couldn't work out how it could be so wrong about my
williame account

~~~
aaronpk
What's wrong about it? It's finding a bunch of C code in this repo:
<https://api.github.com/repos/williame/GlestNG/languages>.

I just realized that it won't take in to account the difference between a repo
you created and one you cloned, it counts both equally.

~~~
udp
> between a repo you created and one you cloned

Forked, you mean.

~~~
aaronpk
yes. oops

------
mrvim
Awesome interface. Very cool.

------
mbetter
From the given numbers, my account (mbetter) is about 40% Haskell, 36%
Javascript and 24% Python. The graph never shows this - sometimes it shows 58%
Haskell, 42% Javascript and other times it shows 100% Python.

