I currently have some broken bones and am struggling to type so sorry if my spelling and grammar makes no sense.
I have a time frame of about a week or so for this as well as some other work which won't be too easy given my current difficulties typing, I am hoping someone can help guide me in the right direction so this is as painless as possible and I can learn as I go.
Basically I need help with creating OO PHP script(s) which can be use for retrieving current exchange rates, for at least 160 different currencies from different sources as required. I need to scrape these sources for rates and store in a mysql db, or using a php script call a convert cgi (ie http://www.xe.com/ucc/convert.cgi?
) and scrape the data returned.
I also need to store related ISO 4217 data for each currency (http://www.iso.org/iso/support/currency_codes_list-1.htm
Using the stored data I can implement my own conversion tool for exchange rates.
The URL on the conversion site I am building specified as: http://thisite.com/conv?amnt=17.65&from=GBP&to=JPY
which will then return xml structured like so
<at>8 November 2010 13:44</at>
<loc> United Kingdom, Crown Dependencies (the Isle of Man and the Channel Islands), certain British Overseas Territories (South Georgia and the South Sandwich Islands,British Antarctic Territory and British Indian Ocean Territory)
or error handling like so
<?xml version="1.0" encoding="UTF-8"?>
<error code=’nnnn’>error message</error>
Some error codes would be:
1000 URL not recognized
1100 Required parameter is missing
1200 Parameter not recognized
2000 Currency type not recognized
I also need to be able to re-scrape data every 24hours to update exchange rates, I am not sure if there is some sort of caching method to do this.
Base Paths, db information and error message data needs to be placed into a config file.
Some possible resources I may use if I can get some idea of how to do this:
I think that is it. So to summarize if someone is kind enough to guide me in the right direction to understanding this it would be brilliant.
I am unsure how to retrieve the data to scrape and store what I need in db
The URL: http://thisite.com/conv?
the lack of file extension after conv has confused me, would this be done with base paths in the config file or another way?
For errors I am unsure how to handle them, would a mistaken query return an error code, which in turn I would use the codes and messages stored in the config file to output the error and
explanation on screen?
How would I automate a caching method to check/update DB with current rates every 24hrs?
Hopefully someone can help as I am clueless how to begin or what to look into to learn what to do?