oudie Newbie


Joined: Dec 18, 2003 Posts: 3
|
Posted: Mon Oct 25, 2004 11:26 pm Post subject: Yahoo Exchange Rate Block |
|
|
ASCurrency module block is great, but doesnt work with my country's currency for some reason. LAO KIP.
So i created my own block to pull exchange rates directly from yahoo finance. I successfully got it to pull the exchange rate for my country.
but i would also like to show the exchange rate for the Thai bhat right below it. Can anyone help me? Here is the code below:
| Code: |
$handle = fopen ("http://finance.yahoo.com/q?s=USDLAK=X", "rb");
$rf = "";
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$rf .= $data;
} while(true);
$grab = eregi( "<td class=\"yfnc_tabledata1\"><big>(.*)</big>", $rf, $printing );
$printing[ 1 ] = str_replace( "<td class=\"yfnc_tabledata1\"><big>", "<big>", $printing[ 1 ] );
fclose( $handle );
$content = $printing[ 1 ].""; |
here is the path to the other rate i want to show along with it:
| Code: |
| http://finance.yahoo.com/q?s=USDTHB=X |
can someone help me modify it so that it also shows that rate below the other one
and one more thing, i am having problems putting an image of my country flag next to it. instead it is shown above the block outside of it. how would i post a image next to the posted exchange rate?
thanks in advance..
-OD |
|