The simplest way is to prepare a static convertor, responsible for returning the pre-assembled list, that will return ( send you ) the Yahoo API Querystring.
A trivial mock-up example is:
string sendMeTheYahooApiQuerySTRING( const string aCurrency1 = "USD",
bool &ErrorFLAG = True
){
switch( aCurrency1 ){
case "USD": ErrorFLAG = False; return( "https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ( "USDEUR", "USDJPY", "USDBGN", "USDCZK", "USDDKK", "USDGBP", "USDHUF", "USDLTL", "USDLVL", "USDPLN", "USDRON", "USDSEK", "USDCHF", "USDNOK", "USDHRK", "USDRUB", "USDTRY", "USDAUD", "USDBRL", "USDCAD", "USDCNY", "USDHKD", "USDIDR", "USDILS", "USDINR", "USDKRW", "USDMXN", "USDMYR", "USDNZD", "USDPHP", "USDSGD", "USDTHB", "USDZAR", "USDISK" )&env=store://datatables.org/alltableswithkeys" );
case "GBP": ErrorFLAG = False; return( "https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ( "GBPEUR", "GBPJPY", "GBPBGN", "GBPCZK", "GBPDKK", "USDGBP", ... )&env=store://datatables.org/alltableswithkeys" );
case "JPY": ErrorFLAG = False; return( "https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ( "GBPJPY", "JPYBGN", ... )&env=store://datatables.org/alltableswithkeys" );
case ... : ErrorFLAG = False; return( ... );
case default: return( "" );
}
designed so as to use it later in:
bool anErrorFLAG = False;
...
string aQuerySTRING = sendMeTheYahooApiQuerySTRING( "DKK", anErrorFLAG );
assert( !anErrorFLAG );
...
This approach relies on Y! side processing, as detailed in API specification:
<execute>
var pairs = [];
for each (var p in pair.toString().replace(/\s+/g,'').split(','))
pairs.push(p.toUpperCase() + '=X');
var q = "select * from csv where url='http://download.finance.yahoo.com/d/quotes.csv?s="+ pairs.join(',') +
"&f=snl1d1t1ab'" + " and columns='Symbol,Name,Rate,Date,Time,Ask,Bid'",
results = y.query(q),
rates = <rates/>,
rows=results.results.row;
for each (var row in rows) {
for each (var item in row.*)
row[item.localName()]=item.text().toString().replace(/"/g, '');
var tag = row.Symbol.text().toString().substr(0,6);
delete row.Symbol;
rates.rate += <rate id={tag}>{row.*}</rate>;
}
response.object = rates;
</execute>
Another way would be to build a set of direct access-iterators that re-use Y! direct access query syntax for returning a single csv-record for each respective currency pair, without Y! side aggregation of results into a common container:
http://download.finance.yahoo.com/d/quotes.csv?s=GBPJPY=X&f=snl1
which retuns as simple data as:
"GBPJPY=X","GBP/JPY",146.7220
without the Y! side re-packaging of the individual exchange rates.