Created
March 19, 2014 12:13
-
-
Save eknowles/9640410 to your computer and use it in GitHub Desktop.
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
import urllib2, urllib | |
import json | |
import StringIO | |
import gzip | |
headers = { | |
"Accept": "*/*", | |
"Accept-Encoding": "gzip,deflate,sdch", | |
"Accept-Language": "en-US,en;q=0.8", | |
"Host": "steamcommunity.com", | |
"Referer": "http://steamcommunity.com/id/ek-/inventory", | |
"Cookie": "xxx", | |
"Origin": "http://steamcommunity.com", | |
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36", | |
"X-Requested-With": "XMLHttpRequest" | |
} | |
data = { | |
"sessionid" : "xxx", | |
"appid" : 730, | |
"contextid" : 2, | |
"assetid" : 118117421, | |
"amount" : 1, | |
"price" : 1000 | |
} | |
target = 'https://steamcommunity.com/market/sellitem/' | |
test = urllib2.Request(target, urllib.urlencode(data), headers) | |
print test.get_full_url() | |
fish = urllib2.urlopen(test) | |
buf = fish.read() | |
print buf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey mate! Thanks a lot for this btw :)
Could please explain me what is the sessionid in the data dict?
Thanks!