Skip to content

Instantly share code, notes, and snippets.

@mehulved
Created March 24, 2012 20:46
Show Gist options
  • Save mehulved/2187621 to your computer and use it in GitHub Desktop.
Save mehulved/2187621 to your computer and use it in GitHub Desktop.
Spell Checking with Google
#!/usr/bin/env python
import requests
import sys
url = "https://www.google.com/tbproxy/spell?lang=en:"
word = sys.argv[1]
xml_struct = """
<spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1">
<text>%s</text>
</spellrequest>"""
r = requests.post(url, xml_struct % word)
print r.content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment