Skip to content

Commit

Permalink
Fixed regex so C++ and Objective-C are matched. Rendering html entiti…
Browse files Browse the repository at this point in the history
…es as

ascii in results. Updated readme with new results
  • Loading branch information
jond3k committed Jan 16, 2012
1 parent 0a16540 commit c346de8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions github-illiteracy-index/README
Expand Up @@ -7,13 +7,15 @@ At the time of writing:

# Language Illiteracy
1 C 0.02877583
2 Perl 0.01635618
3 Ruby 0.01560477
4 JavaScript 0.01330989
5 Shell 0.01235425
6 Python 0.01046104
7 PHP 0.00910218
8 Java 0.00736395
2 C++ 0.01682951
3 Perl 0.01635618
4 Ruby 0.01560477
5 JavaScript 0.01330989
6 Shell 0.01235425
7 Python 0.01046104
8 Objective-C 0.00941299
9 PHP 0.00910218
10 Java 0.00736395

I'm as atonished as you are. C programmers come out worst.. proving to be more
than twice as lexically challenged as the PHP community!
Expand Down
4 changes: 2 additions & 2 deletions github-illiteracy-index/illiteracy.py
Expand Up @@ -7,7 +7,7 @@
SEARCH_URL = 'https://github.com/search?type=Code&language=%s&q=%s'

SEARCH_REGEX = r'<div class="title">Code \(([0-9]+)\)</div>'
LANGS_REGEX = r'<a href="/languages/([\w]*)"\s*class="bar"\s*style="width: [0-9]*%">\s*([0-9]*)%</a>'
LANGS_REGEX = r'<a href="/languages/([^\b"]*)"\s*class="bar"\s*style="width: [0-9]*%">\s*([0-9]*)%</a>'

TERMS = {'length': 'lenght', 'height': 'heigth', 'hierarchy':'heirarchy'}

Expand Down Expand Up @@ -96,7 +96,7 @@ def printSorted(sorted):
i = 0
for result in sorted:
i += 1
print format % (i, result[0], round(result[1], 8))
print format % (i, urllib2.unquote(result[0]), round(result[1], 8))

#langs = {'JavaScript': 20.0}
langs = getLangs()
Expand Down

0 comments on commit c346de8

Please sign in to comment.