Google currency converter API - will it shut down with iGoogle? -
igoogle shutting down.
there (undocumented?) currency conversion api available urls like: http://www.google.com/ig/calculator?hl=en&q=1gbp=?usd
the base of url - google.com/ig - takes igoogle. api available after igoogle shuts down?
i having same issue described here: https://stackoverflow.com/a/19786423/2819754
i used @hobailey answer temporary fix until can update version or google decide proper api.
as google changed url
https://www.google.com/finance/converter?a
so fix found below.
$amount = urlencode($amount); $from_currency = urlencode($from_currency); $to_currency = urlencode($to_currency); $get = file_get_contents("https://www.google.com/finance/converter?a=$amount&from=$from_currency&to=$to_currency"); $get = explode("<span class=bld>",$get); $get = explode("</span>",$get[1]); $converted_amount = preg_replace("/[^0-9\.]/", null, $get[0]);
thanks @hobailey little fix.
Comments
Post a Comment