Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/05/2005, 17:07
Avatar de isaacluz
isaacluz
 
Fecha de Ingreso: marzo-2005
Mensajes: 180
Antigüedad: 19 años, 1 mes
Puntos: 0
una vez hice este .. aver si te sirve.. toma los datos de http://quote.yahoo.com


Código PHP:
<table width="200" border="0" cellpadding="0" cellspacing="0" bgcolor="#AD3039">

<!-- AQUI COMIENZA LO DE LOS MERCADOS-->
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="BOLDIWHITE">INDICADORES
  </tr>
  <tr>
    <td class="chicawhite">
      <?
// PRIMERO NOS CONECTAMOS CON EL SERVIDOR DE YAHOO Y NOS JALAMOS LA INFO .CVS DE CADA UNO
// DE LOS MERCADOS Y CONVERTIMOS LOS VALORES EN UN ARRAY
// IPC
$Original fopen ("http://quote.yahoo.com/d/quotes.csv?s=^MXX&f=sl1d1t1c1ohgv&e=.csv""r");
$Contenidos fread ($Original200);
fclose ($Original);
$Contenidos str_replace ("\""""$Contenidos);
$IPC explode (","$Contenidos);
// DOW
$Original fopen ("http://quote.yahoo.com/d/quotes.csv?s=^DJI&f=sl1d1t1c1ohgv&e=.csv""r");
$Contenidos fread ($Original200);
fclose ($Original);
$Contenidos str_replace ("\""""$Contenidos);
$DOW explode (","$Contenidos);
// NASDAQ
$Original fopen ("http://quote.yahoo.com/d/quotes.csv?s=^IXIC&f=sl1d1t1c1ohgv&e=.csv""r");
$Contenidos fread ($Original200);
fclose ($Original);
$Contenidos str_replace ("\""""$Contenidos);
$NASDAQ explode (","$Contenidos);
// DOLAR
$Original fopen ("http://mx.finance.yahoo.com/d/quotes.csv?s=USDMXN=X&f=sl1d1t1c1ohgv&e=.csv""r");
$Contenidos fread ($Original200);
fclose ($Original);
$Contenidos str_replace ("\""""$Contenidos);
$Dolar explode (","$Contenidos);
// EURO
$Original fopen ("http://espanol.finance.yahoo.com/d/quotes.csv?s=USDEUR=X&f=sl1d1t1c1ohgv&e=.csv""r");
$Contenidos fread ($Original200);
fclose ($Original);
$Contenidos str_replace ("\""""$Contenidos);
$Euro explode (","$Contenidos);
?>
<script type="text/javascript">
Objetos = new Array ('IPC','DOW','NASDAQ','DOLAR','EURO');
function Cambiar (Valor){
    for (i=0;i<Objetos.length;i++){
        Objeto = document.getElementById(Objetos[i]);
        if (Objeto.id == Valor){
            Objeto.style.display = "block";
        }else{
            Objeto.style.display = "none";
        }
    }
}
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
  <td class="BOLDIWHITE">IPC
  <td class="BOLDIWHITE">DOW
  <td class="BOLDIWHITE">NASDAQ
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
  <td class="BOLDIWHITE">DOLAR
  <td class="BOLDIWHITE">EURO
  </tr>
</table>

<hr width="100%" size="1" color="#FFFFFF">
<table width="100%"  border="0" cellpadding="0" cellspacing="0" rules="all" style="display:block;" id="IPC">
<tr>
    <td align="center">[img]http://ichart.finance.yahoo.com/t?s=%5EMXX[/img]
</tr>
<tr>
    <td class="chicawhite">
    Actual: %4$slt;?=$IPC[1]?>

    Fecha: <?=$IPC[2]?>

    Última transacción: <?=$IPC[3]?>

    Diferencia: <?=$IPC[4]?>

    Abierto: <?=$IPC[5]?>

    Rangos del dia: <?=$IPC[7]?>-

    Volumen:<?=$IPC[8]?>
    </td>
</tr>
</table>

<table width="100%"  border="0" cellpadding="0" cellspacing="0" rules="all" style="display:none;" id="DOW">
<tr>
    <td align="center">[img]http://ichart.finance.yahoo.com/t?s=%5EDJI[/img]
</tr>
<tr>
    <td class="chicawhite">
    Actual: %4$slt;?=$DOW[1]?>

    Fecha: <?=$DOW[2]?>

    Última transacción: <?=$DOW[3]?>

    Diferencia: <?=$DOW[4]?>

    Abierto: <?=$DOW[5]?>

    Rangos del dia: <?=$DOW[7]?>-

    Volumen:<?=$DOW[8]?>
    </td>
</tr>
</table>

<table width="100%"  border="0" cellpadding="0" cellspacing="0" rules="all" style="display:none;" id="NASDAQ">
<tr>
    <td align="center">[img]http://ichart.finance.yahoo.com/t?s=%5EIXIC[/img]
</tr>
<tr>
    <td class="chicawhite">
    Actual: %4$slt;?=$NASDAQ[1]?>

    Fecha: <?=$NASDAQ[2]?>

    Última transacción: <?=$NASDAQ[3]?>

    Diferencia: <?=$NASDAQ[4]?>

    Abierto: <?=$NASDAQ[5]?>

    Rangos del dia: <?=$NASDAQ[7]?>-

    Volumen:<?=$NASDAQ[8]?>
    </td>
</tr>
</table>

<table width="100%"  border="0" cellpadding="0" cellspacing="0" rules="all" style="display:none;" id="DOLAR">
<tr>
    <td align="center">[img]http://ichart.yahoo.com/t?s=usdmxn=x[/img]
</tr>
<tr>
    <td class="chicawhite">
    Dolar: %4$slt;?=$Dolar[1]?>

    Fecha: <?=$Dolar[2]?>

    Hora: <?=$Dolar[3]?>
    </td>
</tr>
</table>

<table width="100%"  border="0" cellpadding="0" cellspacing="0" rules="all" style="display:none;" id="EURO">
<tr>
    <td align="center">[img]http://ichart.yahoo.com/t?s=usdeur=x[/img]
</tr>
<tr>
    <td class="chicawhite">
    Euro - Dolar: %4$slt;?=$Euro[1]?>

    Euro - Pesos %4$slt;? echo  ($Dolar[1]/$Euro[1]);?>

    Fecha: <?=$Euro[2]?>

    Hora:<?=$Euro[3]?>
    </td>
</tr>
</table>

<hr width="100%" size="1" color="#FFFFFF">
Dolar: %4$slt;?=$Dolar[1]?>

Euro $ <? echo  ($Dolar[1]/$Euro[1]); ?>

</td>
<!-- AQUI ACABA LO DE LOS MERCADOS-->

</td>
</tr>