Skip to content

Instantly share code, notes, and snippets.

@eknowles
Created March 19, 2014 12:13
Show Gist options
  • Save eknowles/9640410 to your computer and use it in GitHub Desktop.
Save eknowles/9640410 to your computer and use it in GitHub Desktop.
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
@craked5
Copy link

craked5 commented Jun 16, 2015

Hey mate! Thanks a lot for this btw :)
Could please explain me what is the sessionid in the data dict?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment