Skip to content

Instantly share code, notes, and snippets.

@Snawoot
Created April 18, 2014 11:30
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 Snawoot/11039052 to your computer and use it in GitHub Desktop.
Save Snawoot/11039052 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys
import urllib
import urllib2
import re
url = "http://huifikator.ru/huify_text.php"
values = {
"text": " ".join(sys.argv[1:]).decode("utf-8").encode("cp1251"),
}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
the_page = response.read()
print re.search('<div[^>]*>([^<]+)<br/><br/>', the_page.decode("cp1251").encode("utf-8")).group(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment