PhilosChen / appdailysales

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

API to make it easier to incorporate in other scripts #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've attached a patch to make a small public API for this script. It's diff'ed 
with r52 (the latest svn, 
as of now).

The API looks like:

{{{
import appdailysales

scraper = appdailysales.Scraper('username', 'password')
file = scraper.getReport('01/04/2010')
file.unzip() # if you want
file.write() # with an optional argument directory='foo'
                   # and it returns the name of the file it wrote

# and one more, which (for the moment) requires BeautifulSoup
dates = scraper.getAvailableDates()
for date in dates:
   file = scraper.getReport(date)
   file.write()
}}}

The rest of the script is refactored to use this API.

Thanks for the great script! This was a major timesaver (and then I sunk 
several hours into 
refactoring this API :)

Original issue reported on code.google.com by jbe...@gmail.com on 6 Jan 2010 at 9:22

Attachments:

GoogleCodeExporter commented 8 years ago
Nice! Given me a day or two to test and to commit to the trunk.

Original comment by ki...@thecave.com on 6 Jan 2010 at 6:08

GoogleCodeExporter commented 8 years ago
Sorry for the delay getting this change into the trunk. I've been swamped. I 
will get to it 
very soon.

Original comment by ki...@thecave.com on 12 Feb 2010 at 1:26

GoogleCodeExporter commented 8 years ago
No problem. I've got an open source project too, and when life gets in the way, 
it's the first to go :)

Original comment by jbe...@gmail.com on 12 Feb 2010 at 3:58