Until yesterday, I had a great website / budget organizer application working with iGoogle.
Via PHP using the following small line
file_get_contents('http://www.google.com/ig/calculator?hl=en&q=1usd=?eur');
and the like, I was able to get everything I needed.
Today it no longer works. When I looked at this issue, it happened that Google resigned iGoogle. What a nuisance!
In any case, I was looking elsewhere, but I can not find anything that would suit my needs. I would REALLY love to just fix it and run it again just by switching this line of code (i.e. by changing the Google address with the address of another available API), but it seems like it doesn't.
The API from rate-exchange.appspot.com seems like it can be an analogue of iGoogle, but, alas, it never works. I keep getting the message "Over Quota".
(This begs the question: does anyone know a simple, reliable iGoogle API?)
So, I believe that it would be natural to use the Yahoo YQL function (at least I believe that it is just as reliable).
Yahoo requests are as follows:
http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ("USDEUR", "USDJPY", "USDBGN")&env=store://datatables.org/alltableswithkeys
What I really canβt understand is to analyze this data. It outputs XML.
What I used to have is:
function exchange($inputAmount,$inputCurrency,$outputCurrency) { $exchange = file_get_contents('http://www.google.com/ig/calculator?hl=en&q='.$inputAmount.$inputCurrency.'=?'.$outputCurrency); $exchange = explode('"', $exchange); $exchange = explode('.', $exchange['3']); $exchange[0] = str_replace(" ", "",preg_replace('/\D/', '', $exchange[0])); if(isset($exchange[1])){ $exchange[1] = str_replace(" ", "",preg_replace('/\D/', '', $exchange[1])); $exchange = $exchange[0].".".$exchange[1]; } else{ $exchange = $exchange[0]; } return $exchange; }
Thus, the user was able to get the exchange rate from the input currency, such as "US dollar", and the output currency, such as "EUR", for a certain amount of money. As I said, this worked until last night.
Any ideas?