<?php
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json; charset=utf-8');
$price=0;$price2=0; $price3=0;
require 'simple_html_dom.php';
$url = 'http://www.poolred.com/Publico/GraficoIPOOLinfo.aspx?tipo=iVExtra';
$html = file_get_html($url);
$player = $html->find('table[class=tableDatos] td');
$date = str_replace('	', '', $player[22]->innertext);
$date = str_replace(' ', '', $date);
$price = str_replace('	', '', $player[23]->innertext);
$price = str_replace(' ', '', $price);


$url2 = 'http://www.poolred.com/Publico/GraficoIPOOLinfo.aspx?tipo=iVirgen';
$html2 = file_get_html($url2);
$player2 = $html2->find('table[class=tableDatos] td');
$price2 = str_replace('	', '', $player2[23]->innertext);
$price2 = str_replace(' ', '', $price2);


$url3 = 'http://www.poolred.com/Publico/GraficoIPOOLinfo.aspx?tipo=iVl1';
$html3 = file_get_html($url3);
$player3 = $html3->find('table[class=tableDatos] td');
$price3 = str_replace('	', '', $player3[23]->innertext);
$price3 = str_replace(' ', '', $price3);




echo '{"date":"'.$date.'","priceEV":"'.$price.'","priceV":"'.$price2.'  ","priceL":"'.$price3.'"}';


?>