PhilosChen / appdailysales

Automatically exported from code.google.com/p/appdailysales
0 stars 0 forks source link

Errors when running script via command line #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

Just tried using this script via command line and it errors out. Can anyone
tell me why? More importantly - can anyone help me get it working?

Running ubuntu server 8.04 with python 2.5.2

---

root@ev-linsrv:/var/www/itc# python -V
Python 2.5.2
root@ev-linsrv:/var/www/itc# uname -a
Linux ev-linsrv 2.6.24-19-server #1 SMP Wed Jun 18 15:18:00 UTC 2008 i686
GNU/Linux
root@ev-linsrv:/var/www/itc# python appdailysales.py 
Traceback (most recent call last):
  File "appdailysales.py", line 353, in <module>
    sys.exit(main())
  File "appdailysales.py", line 346, in main
    downloadFile(options)
  File "appdailysales.py", line 218, in downloadFile
    html = readHtml(opener, urlWebsite)
  File "appdailysales.py", line 200, in readHtml
    urlHandle = opener.open(request)
  File "/usr/lib/python2.5/urllib2.py", line 381, in open
    response = self._open(req, data)
  File "/usr/lib/python2.5/urllib2.py", line 399, in _open
    '_open', req)
  File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.5/urllib2.py", line 1115, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.5/urllib2.py", line 1082, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (-2, 'Name or service not known')>

---

Original issue reported on code.google.com by admiral....@gmail.com on 16 Mar 2010 at 3:01

GoogleCodeExporter commented 8 years ago
My guess is your computer isn't able to resolve the URL 
https://itts.apple.com/. Trying 
loading the site via a web browser. If that works then try the script again. 
You will also 
need to either include the command line parameters to identify your account or 
modify 
the variables at the top of the script file. More info on using the script is 
available here: 
http://code.google.com/p/appdailysales/

Original comment by ki...@thecave.com on 16 Mar 2010 at 11:51

GoogleCodeExporter commented 8 years ago
Aha upon investigation DNS was not resolving. Fixed, and now I get this:

root@ev-linsrv:/var/www/itc# python appdailysales.py 
03/16/2010 report is not available - try again later.
1 report(s) not available - try again later

Same results when I try again later.

Original comment by admiral....@gmail.com on 17 Mar 2010 at 9:16

GoogleCodeExporter commented 8 years ago
That means the report isn't available. Reports are sometimes delayed. Also 
there is no report if there 
were no sales for a given day.

Original comment by ki...@thecave.com on 17 Mar 2010 at 10:36

GoogleCodeExporter commented 8 years ago
I can log into the iTunes Connect web interface and manually download a report, 
all
the data is there and the report is available with no delays. Then I 
immediately run
the script after, and get 

# python appdailysales.py 
03/17/2010 report is not available - try again later.
1 report(s) not available - try again later

Original comment by admiral....@gmail.com on 18 Mar 2010 at 7:11

GoogleCodeExporter commented 8 years ago
Make sure you are including the correct command line parameters.  Example:

python appdailysales.py -a myAppleId -p myPassword 

You can also include the -v to see a more verbose output. Also, by default the 
script 
only downloads the report from yesterday. Try using the -d parameter to see if 
other 
reports will download.  Example:

python appdailysales.py -a myAppleId -p myPassword -v -d 5

I'm suspecting at the time you ran the script March 17's report wasn't 
available but 
other reports may have been.  

Original comment by ki...@thecave.com on 18 Mar 2010 at 12:42