Skip to content

Instantly share code, notes, and snippets.

@jothirams
Last active December 20, 2015 13:29
Show Gist options
  • Save jothirams/6139703 to your computer and use it in GitHub Desktop.
Save jothirams/6139703 to your computer and use it in GitHub Desktop.
# Connect to Internet from thecloud.eu
# Save this script as 'FTSInternet' in Pythonista and add the
# bookmarklet below to Safari/iCab. The result is copied to the clipboard.
# Bookmarklet:
# javascript:window.location.href='pythonista://FTSInternet?action=run&argv='+encodeURIComponent(window.location.href);
import httplib
numArgs = len(sys.argv)
if numArgs < 2:
print 'Invalid/missing URL argument.'
exit(1)
user = sys.argv[1]
pass = sys.argv[2]
'''
[('content-length', '0'), ('expires', '-1'), ('server', 'gws'), ('cache-control', 'private, max-age=0'), ('date', 'Sat, 20 Sep 2008 06:43:36 GMT'), ('content-type', 'text/html; charset=ISO-8859-1')]
GET https://hospitality.thecloud.eu/cgi-bin/login?user=87065009&pass=65370104&mode_login.x=50&mode_login.y=8&mac=4C%3A0F%3A6E%3A2F%3A7A%3A89&token=%241%2490420655%24QSxjaCK.zeryi94fuOP66.&redirect=http%3A%2F%2Fwww.google.com%2Fsearch%3Fhl%3Den%26q%3Dtest&gateway=&timeout=43200&language=en
'''
conn = httplib.HTTPConnection('hospitality.thecloud.eu')
conn.request('GET', '/cgi-bin/login?user='+user+'&pass='+pass+'&mode_login.x=50&mode_login.y=8&mac=4C%3A0F%3A6E%3A2F%3A7A%3A89&token=%241%2490420655%24QSxjaCK.zeryi94fuOP66.&redirect=http%3A%2F%2Fwww.google.com%2Fsearch%3Fhl%3Den%26q%3Dtest&gateway=&timeout=43200&language=en')
res = conn.getresponse()
print res.status, res.reason
print res.getheaders()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment