Permalink
Browse files

Fixed regex so C++ and Objective-C are matched. Rendering html entiti…

…es as

ascii in results. Updated readme with new results
  • Loading branch information...
1 parent 0a16540 commit c346de8706925405b672cb690f27f840e87c3ad8 @jond3k committed Jan 16, 2012
Showing with 11 additions and 9 deletions.
  1. +9 −7 github-illiteracy-index/README
  2. +2 −2 github-illiteracy-index/illiteracy.py
@@ -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!
@@ -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'}
@@ -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()

0 comments on commit c346de8

Please sign in to comment.