Created
January 5, 2014 03:23
-
-
Save AntoineTurmel/8263904 to your computer and use it in GitHub Desktop.
Script to print missing strings on a specific Songbird locale (no more working since servers are down)
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
#!/usr/bin/python | |
import urllib | |
import sys | |
if len(sys.argv) == 1: | |
print "You must specify a locale" | |
else: | |
f = urllib.urlopen("http://translate.songbirdnest.com/languages/" + sys.argv[1]) | |
from BeautifulSoup import BeautifulSoup | |
html = f.read() | |
soup = BeautifulSoup(''.join(html)) | |
table = soup.find('table') | |
rows = table.findAll('tr') | |
for tr in rows: | |
cols = tr.findAll('td') | |
for td in cols: | |
text = td.find(text=True) | |
if text != None: | |
text = ''.join(td.find(text=True)) | |
print text+"", | |
break | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment