Continuing my prior post where I talk about my server replacement, a Synology NAS (DS211j). In essence, a cheap, tiny dedicated Linux box featuring an ARM CPU and custom web UI specially designed for SUPER EASY RAID array maintenance and creation. There’s a 4 drive version, some many-more drive versions, but they cost more.
This time, I’m here to talk about a little tool for getting your daily sales data from Apple’s iTunes Connect website. AppDailySales!
http://code.google.com/p/appdailysales/
This is a python script I was recommended some months back, but it needed a few things IMO. So in a shocking rare case of OSS justice, I added the features I wanted myself and submitted a patch:
http://code.google.com/p/appdailysales/issues/detail?id=31&can=1
Just a few days ago (nine months later), version 2.9 was released (sparked by Apple’s change to the system), now including my patches! 😀
To run the script, all you need is Python. Before I used to run this on Windows XP (Python installed in C:\Python2.7\, with PATH environment variable set to include this).
Now with the NAS, I SSH in to the device (Go download Putty if on Windows), login as root (same password as admin), and install the python package.
ipkg install python
Easy. Done.
Place the AppDailySales.py script somewhere on your computer, likely in the same folder you want your stats placed. Then simply invoke it with –help to get a list of arguments.
python appdailysales.py --help
I run it from a batch file or script. My old Batch File Version looks like this:
1 |
python appdailysales.py -a me@mydomain.com -p mypassword -f %%Y/%%Y-%%m/Daily-%%Y-%%m-%%d.txt -u -d 14 -v -n |
The new, shockingly similar shell script version (i.e. only single %’s) is this:
1 2 |
#!/bin/sh python appdailysales.py -a me@mydoman.com -p mypassword -f %Y/%Y-%m/Daily-%Y-%m-%d.txt -u -d 14 -v -n |
This creates files like so:
2010/2010-12/Daily-2010-12-13.txt
2010/2010-12/Daily-2010-12-12.txt
2010/2010-12/Daily-2010-12-11.txt
2010/2010-12/Daily-2010-12-10.txt
Nice and easy to read names, unlike the default files generated by iTunes Connect.
In the next section, I’ll talk more about setting it up as a service. In other words, totally automated!