Memention Blog

Lightweight backup for AppSales-Mobile


I have for some time been using AppSales-Mobile to download and view sales reports from iTunesConnect. Without it is’s a little hazzle to login, click to the right page and download a csv file full with numbers and stuff. With AppSales-Mobile it’s all prepared and the download can be handled on the road, and more important, the reports are presented in a more humane way.

But occasionally Apple changes the html pages that are scrapped of information to login and fetch the reports. Every time this happens an update of AppSales-Mobile is needed, and every time there is the risk of loosing all previous saved reports. It’s open source software so why not add this as a little feature.

As I have very little time to put on projects like this I thought of a lightweight solution. The solution I thought of was in the line as below:

upload safari

I actually started with the php script as it’s good having it in place while doing the http post testing. I selected a very simple method. I imagine the users of AppSales-Mobile mostly are developers so a simplified way will work fine. Well, having very limited time to spend on it was also a major factor I guess and this method was something that I managed to get to work pretty fine for my needs. The php script can receive files and places them in /tmp/AppSales-Backup/. It can be placed in the users Sites folder. You can have a look at it at github: upload_appsales.php

Sending the report files was only a matter of looping over all Day objects in the days and weeks collections I found in the AppSales-Mobile sources and posting their individual files by http. Well, I’m lazy and things like this should be done asynchronous so I choose an open source framework to send the files, ASIHTTPRequest

I decided not to add some extra UI panels to inputing the target url to post the files to. It is hardcoded and I used a #error tag so it will easily be found when compiling the project the first time. I hope most developers can figure it out.

upload info

I added a Backup button to the settings panel to activate backup. When tapping it the button is removed and a list of Day objects is created from which a background thread will be sending from. The backup activity can be seen on the front page where the usual login and fetch activity is shown.

xcode prefetched

When the files finally have been saved to the backup folder /tmp/AppSales-Backup/ they should be moved to a more safe place. They can also be placed in the Xcode project for AppSales-Mobile. Just place the .dat files in the Prefetched folder and they will automatically show up in the Xcode project. Then they will be included in a new AppSales-Mobile bundle and read when it loads even though all data has been lost by ie a mistaken delete of the bundle or a needed reset of the device.

If you like to use my added backup feature grab the Xcode project at github and try it out. Note that I also merged a Totals panel ktakayama have added.

http://github.com/epatel/AppSales-Mobile

By Edward Patel, 22 Nov 2009




Show comments

Archive

Getting there13 Mar 2014
Throwing pebbles12 Jul 2013
Provision this!30 Aug 2012
Break what?18 Aug 2011
That old thing04 May 2011
Removing a Step15 May 2010
Make It Work22 Feb 2010
KISS server31 Jan 2010
tig on Mac12 Dec 2009
The XML Runner31 Oct 2009
Get some software from Memention
Powered by Jekyll and Disqus.
Copyright © 2010-2013 Memention AB