Created
July 10, 2012 09:46
-
-
Save melvincarvalho/3082339 to your computer and use it in GitHub Desktop.
command line to MyProfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urllib | |
import httplib2 | |
cert_file = 'e.pem' | |
http = httplib2.Http(disable_ssl_certificate_validation=True) | |
http.add_certificate('', cert_file, domain='') | |
url = 'https://auth.my-profile.eu/auth/index.php?authreqissuer=https://my-profile.eu/index.php' | |
response, content = http.request(url) | |
headers = {'Cookie': response['set-cookie'], 'Content-type': 'application/x-www-form-urlencoded'} | |
newurl = 'https://my-profile.eu/wall.php' | |
body = { 'comment' : 'curltest', 'user' : 'local', 'new' : '1' } | |
response, content = http.request(newurl, 'POST', headers=headers, body=urllib.urlencode(body)) | |
print content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment