NAME

iTunesConnect - An iTunesConnect client interface

SYNOPSIS

use WWW::iTunesConnect;

my $itc = WWW::iTunesConnect->new(user=>$user, password=>$password);
my %report = $itc->daily_sales_summary;

DESCRIPTION

iTunesConnect provides an interface to Apple's iTunes Connect website. For now only the previous day's daily sales summary can be retrieved. This is just a quick first cut that I whipped up to avoid losing any data. Eventually this will be a complete interface.

CONSTRUCTOR

$itc = iTunesConnect->new;

Constructs and returns a new iTunesConnect interface object. Accepts a hash containing the iTunes Connect username and password.

ATTRIBUTES

$itc->user

Get/Set the iTunes Connect username. NOTE: User and Password must be set before calling any other methods.

$itc->password

Get/Set the iTunes Connect password. NOTE: User and Password must be set before calling any other methods.

METHODS

These methods fetch various bits of information from the iTunes Connect servers. Everything here uses LWP and is therefore essentially a screen scraper. So, be careful and try not to load up Apple's servers too much. We don't want them to make this any more difficult than it already is.

$itc->login()

Uses the username and password properties to authenticate to the iTunes Connect server. This is automatically called as needed by the other fetch methods if user and password have already been set.

$itc->daily_sales_summary_dates

Fetch the list of available dates for Sales/Trend Daily Summary Reports. This caches the returned results so it can be safely called multiple times. Note, however, that if the parent script runs for longer than 24 hours the cached results will be invalid.

Dates are sorted in descending order.

$itc->daily_sales_summary()

Fetch the most recent Sales/Trends Daily Summary report and return it as a hash of array references. The returned hash has four elements: header, data, file and filename. The header element is an array of the column headers in the fetched TSV file. The data element is an array of array references, one for each non-header line in the fetched TSV file. The file element is the raw content of the file retrieved from iTunes Connect and the filename element is the filename provided by the Content-Disposition header line.

If a single string argument is given in the form 'MM/DD/YYYY' that date will be fetched instead (if it's available).

SEE ALSO

LWP HTML::Form IO::Uncompress::Gunzip Net::SSLeay

AUTHOR

Brandon Fosdick, <bfoz@bfoz.net>

COPYRIGHT AND LICENSE

Copyright 2008 Brandon Fosdick <bfoz@bfoz.net>

This software is provided under the terms of the BSD License.