Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, json
- from sys import argv
- script, purchase_code = argv
- """
- Remove lines 10,11 if you don't wish to extract the credentials from a file.
- And don't forget to replace "username" and "apikey" from line 14 & 15.
- """
- with open('credentials.txt','r') as f:
- lines = ([line.rstrip() for line in f])
- username = lines[0] #-> credentials.txt, line1 should contain your username
- apikey = lines[1] #-> credentials.txt, line2 should contain your API key
- link = ('http://marketplace.envato.com/api/edge/%s/%s/verify-purchase:%s.json')%(username, apikey, argv[1])
- req = urllib.urlopen(link)
- res = req.read()
- ans = json.loads(res)
- print json.dumps(ans, sort_keys = True, indent = 4, separators=(',',': '))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement