Skip to content

Instantly share code, notes, and snippets.

@MasterOdin
Created August 4, 2014 23:19
Show Gist options
  • Save MasterOdin/6b9267946aaaee6f7178 to your computer and use it in GitHub Desktop.
Save MasterOdin/6b9267946aaaee6f7178 to your computer and use it in GitHub Desktop.
Python QRServer API Script
import requests
import urllib
from PIL import Image
from StringIO import StringIO
base = "http://forums.somethingawful.com/showthread.php?"
base = base + "threadid=3571852&pagenumber=204#lastpost"
url = urllib.quote(base)
r = requests.get("http://api.qrserver.com/v1/create-qr-code/?data=" + url + "&size=200x200")
print r.status_code
i = Image.open(StringIO(r.content))
i.show()
# use i.save(name,format) here probably
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment