Improving of php scripts (yahoo finance)

Improving of php scripts (yahoo finance)

Closed - This job posting has been filled.

Job Description

I would like to change the way of gathering data from yahoo.

Please find attached files - currently script cron.php is getting currencies list from module table (file modules.sql) and then download data for each pair of currency and saving into database (rates_history.sql)

Because script is getting data for each pair separately, for more currencies it takes lots of time and also creates hundreds of separate downloads from yahoo.

I found that is possible to take more than one currencies at once, for example.

http://finance.yahoo.com/d/quotes.csv?f=sl1d1t1&s=GBPUSD=X+GBPCAD=X+GBPEUR=X

In other words, just add +AAABBB=X for each entry at the end.

So my idea is to get at once all possible pairs for one currency for example, if we have 10 currencies like this:
PLN,THB,USD,AUD,HKD,CAD,NZD,SGD,EUR,HUF

at first time script should take

http://finance.yahoo.com/d/quotes.csv?f=sl1d1t1&s=PLNTHB=X+PLNUSD=X+PLNAUD=X+PLNHKD=X+PLNCAD=X+PLNNZD=X+PLNSGD=X+PLNEUR=X+PLNHUF=X
at second time we get another currency

http://finance.yahoo.com/d/quotes.csv?f=sl1d1t1&s=THBPLN=X+THBUSD=X+THBAUD=X+THBHKD=X+THBCAD=X+THBNZD=X+THBSGD=X+THBEUR=X+THBHUF=X
and add so one.


Thanks to this script will be run only 10 times instead of 100, and I will have results for each pair both way (USDPLN and PLNUSD)

Please do not hesitate to contact me if any additional information are needed.

---
Skills: yahoo, finance

Open Attachment