Skip to content

Instantly share code, notes, and snippets.

@AntoineTurmel
Created January 5, 2014 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AntoineTurmel/8263904 to your computer and use it in GitHub Desktop.
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)
#!/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
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment