0byt3m1n1
Path:
/
home
/
mgatv524
/
public_html
/
loterias
/
Convert
/
[
Home
]
File: DuplaSena.php
<?php $url = 'https://apiloterias.com.br/app/resultado?loteria=duplasena&token=76TnReoSyzEv4g4'; $contents = file_get_contents($url); $contents = utf8_encode($contents); $results = json_decode($contents); $acumulou = $results->acumulou ? 'ACUMULOU' : 'ESTIMATIVA'; $ar_date_time = explode('T', $results->data_concurso); $ar_date = explode('-', $ar_date_time[0]); $data = implode('/', array_reverse($ar_date)); $ar_next_date_time = explode('T', $results->data_proximo_concurso); $ar_next_date = explode('-', $ar_next_date_time[0]); $proxima_data = implode('/', array_reverse($ar_next_date)); $state = explode(',', $results->local_realizacao); $uf = trim($state[1]); $numbers1 = array_merge($results->dezenas); sort($numbers1); $numbers2 = array_merge($results->dezenas_2); sort($numbers2); $xml = '<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title>DuplaSena</title> <description>Loterias</description> <language>pt-br</language> <item> <AcumuladoEspecial>'. $acumulou .'</AcumuladoEspecial> <Cidade>'. $results->local_realizacao .'</Cidade> <Concurso>'. $results->numero_concurso .'</Concurso> <Data>'. $data .'</Data> <Dezena1_1>'. $numbers1[0] .'</Dezena1_1> <Dezena1_2>'. $numbers1[1] .'</Dezena1_2> <Dezena1_3>'. $numbers1[2] .'</Dezena1_3> <Dezena1_4>'. $numbers1[3] .'</Dezena1_4> <Dezena1_5>'. $numbers1[4] .'</Dezena1_5> <Dezena1_6>'. $numbers1[5] .'</Dezena1_6> <Dezena2_1>'. $numbers2[0] .'</Dezena2_1> <Dezena2_2>'. $numbers2[1] .'</Dezena2_2> <Dezena2_3>'. $numbers2[2] .'</Dezena2_3> <Dezena2_4>'. $numbers2[3] .'</Dezena2_4> <Dezena2_5>'. $numbers2[4] .'</Dezena2_5> <Dezena2_6>'. $numbers2[5] .'</Dezena2_6> <Local>ESPAÇO LOTERIAS CAIXA</Local> <UF>'. $uf .'</UF> <ProximoData>'. $proxima_data .'</ProximoData> <ProximoConcurso>'. $results->concurso_proximo .'</ProximoConcurso> <ProximoEstimativaPremio>R$ '. number_format($results->valor_estimado_proximo_concurso, 2, ',', '.') .'</ProximoEstimativaPremio> <ProximoValorAcumulador>R$ '. number_format($results->valor_final_concurso_acumulado, 2, ',', '.') .'</ProximoValorAcumulador> <linkfoto>http://www.mgaplay.com.br/loterias/img/DuplaSena.jpg</linkfoto> </item> </channel> </rss>'; header("Content-type: text/xml"); echo $xml; ?>