Want more features on Pastebin? Sign Up, it's FREE!
Guest

script to get iOS app original release date

By: a guest on Apr 19th, 2012  |  syntax: Python  |  size: 0.67 KB  |  views: 93  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import json, httplib, sys
  2.  
  3. strAppId = ''
  4.  
  5. if len(sys.argv) != 2:
  6.         print 'Require app id as first argument... exiting.'
  7.         sys.exit(-1)
  8. else:
  9.         strAppId = sys.argv[1]
  10.  
  11. trackName = ''
  12. releaseDate = ''
  13.  
  14. conn = httplib.HTTPConnection('itunes.apple.com')
  15. conn.request('GET', '/lookup?id=%s' % strAppId)
  16. res = conn.getresponse()
  17. if res.status == 200:
  18.     strData = res.read()
  19.     dictData = json.loads(strData)
  20.     if dictData['resultCount'] == 1:
  21.         dictResults = dictData['results'][0]
  22.         trackName = dictResults[u'trackName']
  23.         releaseDate = dictResults[u'releaseDate']
  24. conn.close()
  25.  
  26. print 'App name: ', trackName
  27. print 'Release date:', releaseDate
clone this paste RAW Paste Data