0byt3m1n1
Path:
/
home
/
mgatv524
/
public_html
/
loterias
/
Convert
/
[
Home
]
File: MegaSena.php
<?php $url = 'https://apiloterias.com.br/app/resultado?loteria=megasena&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]); $xml = '<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title>MegaSena</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>'. $results->dezenas[0] .'</Dezena1_1> <Dezena1_2>'. $results->dezenas[1] .'</Dezena1_2> <Dezena1_3>'. $results->dezenas[2] .'</Dezena1_3> <Dezena1_4>'. $results->dezenas[3] .'</Dezena1_4> <Dezena1_5>'. $results->dezenas[4] .'</Dezena1_5> <Dezena1_6>'. $results->dezenas[5] .'</Dezena1_6> <Local>Espaço Loterias Caixa</Local> <UF>'. $uf .'</UF> <ProximoData>'. $proxima_data .'</ProximoData> <ProximoConcurso>'. $results->concurso_proximo .'</ProximoConcurso> <Acumulou>R$ '. number_format($results->valor_acumulado, 2, ',', '.') .'</Acumulou> <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/MegaSena.jpg</linkfoto> </item> </channel> </rss>'; header("Content-type: text/xml"); echo $xml; ?>