Scrape 2 AJAX-enabled web pages with PHP5 and cURL
This task is to modify the PHP5 script attached below, to log in to the Disney World website, and using PHP and cURL, mimic the AJAX calls in the "My Vacations" page to retrieve the vacation data, then save that data to a text file on disk.
There are three steps to doing this:
(1) Log in – I believe Disney assigns security/authorization/ID tokens upon successful login, and these are needed for subsequent calls back to the site. I'll pass you the username and password to use to log in, via the command line.
(2) Once you've logged in, you'll need to figure out what AJAX calls are happening behind the scenes of the "My Vacations" page to retrieve data from Disney's servers. I've documented what I think is the structure of the call, in the attached Word doc.
(3) You'll need to mimic those AJAX calls using PHP and cURL, and aggregate all of the results, then save those results as a text file.
You'll need to use a sniffing tool such as Firebug or HttpFox to figure out the exact format of the Ajax calls that get the data used to populate the "My Vacations" page. You'll also need to figure out how to log in, capture, and use any security or customer ID credentials.
The Word document (attached) contains screen captures of the screens you'll see while doing this manually, as well as some data and URLs previously captured in HttpFox.
Our current environment is Ubuntu 12.04 LTS with PHP 5.3.10. Please stay as close to that environment as possible.
If you absolutely must use something other than straight PHP5 and cURL, please provide an explanation as to why.
I'll probably run the code this way:
php get_fp_times.php -u username -p password
where "username" and "password" are the login credentials to use when logging in.
The attached document contains important additional information about this task.
I'd prefer you modify the existing, attached PHP code instead of writing your own.
Please include in your proposal enough time for one or two calls via Skype to answer questions either you or I may have about the code.
Thanks very much!