programacion.xml Si usan tvtime (personalmente el mejor tv player) pueden ponerlo en ~/.tvtime/programacion.xml y ejecutar `tvtime-configure --xmltv=~/.tvtime/programacion.xml` una sola vez y automaticamente se cargara y usara siempre. Si usan mythtv, todo esto se puede configurar con un lindo frontend. Aclaraciones y limitaciones Lamentablemente en esta version esta todo hardcodeado, canales y estaciones con la distribucion que se emite en Buenos Aires, no por un sentido poco federal sino porque primero lo hice son pensar en publicarlo y luego lo adapte para un amigo. Supongo que en versiones subsiguiente abstraere el sistema de canales para que el usuario pueda facilmente cambiarlo segun su region y preferencias. Otro problema es que como el parser esta hecho a partir de la pagina de Multicanal, la progrmacion de algunos canales de otros proveedores no aparecen. No son muchos y los principales estan. A diferencia de otros sistema tv_grab_* este no tiene un servidor de mantenimiento, cada vez que uno corre en programa, uno hace de server y cliente con lo que es mas carga sobre el server de Multicanal. Si bien son una corporacion con muchos recursos tampoco es para abusar, usenlo solo lo necesario. Dependencias PHP +5.x (http://www.php.net) xmltv (http://xmltv.sourceforge.net) (recomendado por el uso del tv_sort) Changelog 1.0 - Release inicial 1.1 - Agregado soporte cURL 1.2 - Modificada grilla Cablevision 1.3 - Actualizada a nueva URL - Ahora requiere CURL 1.4 - Modificada grilla Cablevision al 03/08/2007 + Conversión de caracteres a ISO-8859-1 + correción en la variable de STOP 1.4.1b - Se agrega como inicializacion una funcion para tomar datos de cookie 1.5 - Se agregan los iconos de los canales sacados de "http://www.lyngsat-logo.com/" + Detalles de los programas 1.5.1 - Se agrego parametro de configuracion para la inclusión de detalles de programación Version 1.5.1 04/09/2007 Version 1.0 by grunjol@argenteam.net Version 1.3 mod by drgenio Version 1.4 by GaMbIt (fer_s@yahoo.com) Version 1.4.1b by Gsas2 Version 1.5 by Lemac Version 1.5.1 by grunjol http://www.argenteam.net/soft/tv_grab_ar */ // Definicion de proveedores NO TOCAR define('MULTICANAL',0); define('CABLEVISION',1); define('TELECENTRO',2); // Configuracion // provider: Selecciona tu proveedor de cable // fecthDescription:: Indica si trae tambien la información del programa (true) o no (false). // IMPORTANTE: El script tardará mucho mas tiempo en traer la información. Usar si posee una buena conexión. $provider = CABLEVISION; $fecthDescription = true; // main (No tocar debajo de esta linea) error_reporting(0); ini_set("memory_limit","128M"); $p = new MCParser($provider); $p->setDescriptionFetchEnabled($fecthDescription); $x = $p->parseIntoXMLTV(); $strXML = $x->getXML(); echo $strXML; // // Clases de XMLTV // class Xmltv { private $channels; function Xmltv() { $channels = array(); } function addChannel($channel) { $this->channels[] = $channel; } function getChannels() { return $this->channels; } function setChannels($channels) { $this->channels = $channels; } function getXML() { $buffer = xmlwriter_open_memory(); xmlwriter_set_indent($buffer, true); xmlwriter_start_document($buffer,'1.0','UTF-8'); // xmlwriter_start_element ($buffer,'tv'); // xmlwriter_write_attribute($buffer, 'source-info-url', 'http://www.buscadormulticanal.com.ar/'); xmlwriter_write_attribute($buffer, 'source-data-url', 'http://tv.argenteam.net/'); xmlwriter_write_attribute($buffer, 'generator-info-name', 'argenteamXMLTV/1.5.1'); $channels = $this->getChannels(); foreach($channels as $channel) $channel->getXML($buffer); foreach($channels as $channel) { $programmes = $channel->getProgrammes(); foreach($programmes as $programme) $programme->getXML($buffer); } xmlwriter_end_element($buffer); // $xml = xmlwriter_output_memory($buffer,true); return $xml; } } class XmltvChannel { private $id; private $programmes; private $displayNames; function XmltvChannel($id='') { $this->setId($id); $this->programmes = array(); $this->displayNames = array(); } function getId() { return $this->id; } function setId($id) { $this->id = $id; } function getProgrammes() { return $this->programmes; } function setProgrammes($programmes) { foreach($programmes as &$programme) $programme->setChannelId($this->getId()); $this->programmes = $programmes; } function addProgramme($programme) { $programme->setChannelId($this->getId()); $this->programmes[] = $programme; } function getDisplayNames() { return $this->displayNames; } function setDisplayNames($displayNames) { $this->displayNames = $displayNames; } function addDisplayName($displayName) { $this->displayNames[] = $displayName; } function getIcons() { return $this->icons; } function setIcons($icons) { $this->icons = $icons; } function addIcon($icon) { $this->icons[] = $icon; } function getXML(&$buffer) { xmlwriter_start_element($buffer,'channel'); // xmlwriter_write_attribute($buffer,'id',$this->getId()); $displayNames = $this->getDisplayNames(); foreach($displayNames as $displayName) xmlwriter_write_element($buffer,'display-name',utf8_encode($displayName)); $icons = $this->getIcons(); foreach($icons as $icon) { xmlwriter_start_element($buffer,'icon'); xmlwriter_write_attribute($buffer,'src',$icon); xmlwriter_end_element($buffer); } xmlwriter_end_element($buffer); // } } class XmltvProgramme { private $channelId; private $start; private $stop; private $titles; private $descriptions; function XmltvProgramme($channelId='') { $this->setChannelId($channelId); $this->titles = array(); $this->descriptions = array(); } function getChannelId () { return $this->channelId; } function setChannelId ($channelId) { $this->channelId = $channelId; } function getStart() { return $this->start; } function setStart($start) { $start = date("YmdHis",$start); $this->start = $start." -0300"; } function getStop() { return $this->stop; } function setStop($stop) { $stop = date("YmdHis",$stop); $this->stop = $stop." -0300"; } function getTitles() { return $this->titles; } function setTitles($titles) { $this->titles = $titles; } function addTitle($title) { $this->titles[] = $title; } function getDescriptions() { return $this->descriptions; } function setDescriptions($descriptions) { $this->descriptions = $descriptions; } function addDescription($description) { $this->descriptions[] = $description; } function getXML(&$buffer) { xmlwriter_start_element($buffer,'programme'); // xmlwriter_write_attribute($buffer,'start',$this->getStart()); if($this->getStop()) xmlwriter_write_attribute($buffer,'stop',$this->getStop()); xmlwriter_write_attribute($buffer,'channel',$this->getChannelId()); $titles = $this->getTitles(); foreach($titles as $title) xmlwriter_write_element($buffer,'title',utf8_encode($title)); $descriptions = $this->getDescriptions(); foreach($descriptions as $description) { if(trim($description)) xmlwriter_write_element($buffer,'desc',utf8_encode($description)); } xmlwriter_end_element($buffer); // } } // // Parser de la pagina de multicanal (no jodan mucho que si se avivan nos cortan a todos) // class MCParser { private $mcChannelMap; private $network; private $descriptionFecth; function MCParser($network = MULTICANAL) { $this->loadMCMap(); $this->setNetwork($network); $this->set_initial_cookie($network); } function setNetwork($network) { $this->network = $network; } function getNetwork() { return $this->network; } function setDescriptionFetchEnabled($descriptionFetch) { $this->descriptionFecth = ($descriptionFetch) ? true : false; } function isDescriptionFetchEnabled() { return $this->descriptionFecth; } function parseIntoXMLTV () { $x = new Xmltv(); foreach($this->mcChannelMap as $channelId => $channelInfo) { $programs = $this->getWeekInfoForChannel($channelId); $programs = array_merge($programs, $this->getWeekInfoForChannel($channelId,1)); $programs = $this->sortPrograms($programs); if(!$channelInfo[$this->getNetwork()]) continue; $xmltvChannel = new XmltvChannel($channelInfo[3]); $xmltvChannel->addDisplayName($channelInfo[4]); $xmltvChannel->addDisplayName($channelInfo[$this->getNetwork()]); $xmltvChannel->addIcon($channelInfo[5]); foreach($programs as &$program) { $xmltvProgramme = new XmltvProgramme(); $xmltvProgramme->setStart($program['start']); $xmltvProgramme->setStop($program['stop']); $xmltvProgramme->addTitle($program['title']); $xmltvProgramme->addDescription($program['description']); $xmltvChannel->addProgramme($xmltvProgramme); } $x->addChannel($xmltvChannel); } return $x; } function getWeekInfo($week=0) { $programs = array(); foreach($this->mcChannelMap as $channelId => $channelInfo) $programs = array_merge($programs,$this->getWeekInfoForChannel($channelId)); return $programs; } function getWeekInfoForChannel($channelId,$week=0) { $pageString = $this->fetchPage("http://www.buscadormulticanal.com.ar/index.php?template=fgrilla_semanal.tpl&canal=$channelId&semana=$week"); $parsedWeek = $this->parseWeekPage($pageString); $weekPrograms = $this->createWeekPrograms($parsedWeek,$week); return $weekPrograms; } function fetchPage($url) { return $this->file_url_get_contents($url); } function parseWeekPage($pageString) { $programMatches = array(); $pattern = "|
|i"; preg_match_all($pattern,$pageString, $programMatches,PREG_SET_ORDER); $pattern = "||i"; preg_match_all($pattern,$pageString, $programLinkMatches,PREG_SET_ORDER); $pattern_des = "|([^']+)|U"; for ($i = 0; $i < sizeof($programMatches); $i++) { $programMatches[$i] = array_slice($programMatches[$i],1); $programMatches[$i][] = $programLinkMatches[$i][1]; if($this->isDescriptionFetchEnabled()) { $pageDesString = $this->fetchPage("http://www.buscadormulticanal.com.ar/index.php?verFicha=".$programLinkMatches[$i][1]); preg_match_all($pattern_des,$pageDesString, $programDesMatches, PREG_SET_ORDER); $programMatches[$i][] = $programDesMatches[0][1]; } } return $programMatches; } function createWeekPrograms($programMatches,$weekOffset=0) { $programs = array(); $nowA = getdate(); $startDay = mktime(0,0,0, $nowA["mon"], $nowA["mday"]-($nowA["wday"]+6)%7+7*$weekOffset ,$nowA["year"]); $startDayA = getdate($startDay); foreach($programMatches as $programMatch) { $program["title"] = $programMatch[0]; $program["programId"] = $programMatch[5]; $program["description"] = $programMatch[6]; $program["duration"] = $programMatch[4]/64*3600; $program["startHour"] = $programMatch[1]/64*3600; $emitions = round($programMatch[3]/100); for($d = 0; $d < $emitions; $d++) { $programStartDay = (round(($programMatch[2]-47)/98)+$d)*24*3600; $program["start"] = $startDay + $programStartDay + $program["startHour"]; $program["stop"] = $program["start"] + $program["duration"]; $programs[$program["start"]] = $program; } } return $programs; } function sortPrograms($programs) { ksort($programs); $programs = array_values($programs); for ($i = 1; $i < sizeof($programs); $i++) { if($programs[$i]["startHour"]==0 && $programs[$i]["start"] == $programs[$i-1]["stop"] && $programs[$i]["programId"] == $programs[$i-1]["programId"]) { $programs[$i-1]["stop"] = $programs[$i]["stop"]; $programs[$i-1]["duration"] = $programs[$i-1]["duration"] + $programs[$i]["duration"]; unset($programs[$i]); } } return $programs; } function loadMCMap() { // [mcChannelID] = multicanal(0) | cablevision(1) | telecentro(2) | urlId(3) | displayName(4) | icon(5) $this->mcChannelMap["47"] = array("2","40","15","www.mundonick.com","Nickelodeon","http://www.lyngsat-logo.com/icon/tv/nn/nickelodeon.gif"); $this->mcChannelMap["75"] = array("3","09","14","www.america2.com.ar","América TV","http://www.lyngsat-logo.com/icon/tv/aa/america_satelital_arg.gif"); $this->mcChannelMap["2"] = array("4","41","18","www.cartoonnetwork.com.ar","Cartoon Network","http://www.lyngsat-logo.com/icon/tv/cc/cartoon_network.gif"); $this->mcChannelMap["25"] = array("5","43","16","tudiscoverykids.com","Discovery Kids","http://www.lyngsat-logo.com/icon/tv/dd/discovery_kids.gif"); $this->mcChannelMap["79"] = array("6","15","4","www.canal7argentina.com.ar","Canal 7","http://www.lyngsat-logo.com/icon/tv/cc/canal_siete.gif"); $this->mcChannelMap["216"] = array("6","69","","www.cmtv.com.ar","CM El canal de la música",""); $this->mcChannelMap["1"] = array("7","44","20","boomerang.cartoonnetwork.com.ar","Boomerang","http://www.lyngsat-logo.com/icon/tv/bb/boomerang_sam.gif"); $this->mcChannelMap["78"] = array("8","8","8","canal9.infobae.com","Canal 9","http://www.lyngsat-logo.com/icon/tv/cc/canal9_ar.gif"); $this->mcChannelMap["102"] = array("9","39","19","www.disneylatino.com","Disney Channel","http://www.lyngsat-logo.com/icon/tv/dd/disney_channel.gif"); $this->mcChannelMap["120"] = array("10","10","10","www.telefe.com.ar","Telefé","http://www.lyngsat-logo.com/icon/tv/tt/telefe.gif"); $this->mcChannelMap["28"] = array("11","42","17","www.jetixtv.com","Jetix","http://www.lyngsat-logo.com/icon/tv/jj/jetix.gif"); $this->mcChannelMap["77"] = array("12","12","12","www.artear.com.ar","Canal 13","http://www.lyngsat-logo.com/icon/tv/cc/canal13_satelital.gif"); $this->mcChannelMap["37"] = array("13","21","49","www.mgm.tv","MGM","http://www.lyngsat-logo.com/icon/tv/mm/mgm.gif"); $this->mcChannelMap["66"] = array("14","11","","www.tn24horas.com","TN","http://www.lyngsat-logo.com/icon/tv/tt/todo_noticias.gif"); $this->mcChannelMap["38"] = array("15","14","","magazine.nourl.tv","Magazine","http://www.lyngsat-logo.com/icon/tv/mm/magazine.gif"); $this->mcChannelMap["81"] = array("16","16","22","espnplus.espndeportes.com","ESPN+","http://www.lyngsat-logo.com/icon/tv/ee/espn_plus.gif"); $this->mcChannelMap["56"] = array("17","17","","www.tycsports.com.ar","TyC Sports","http://www.lyngsat-logo.com/icon/tv/tt/tyc_sports.gif"); $this->mcChannelMap["10"] = array("18","18","21","www.foxsportsla.com","Fox Sports","http://www.lyngsat-logo.com/icon/tv/ff/foxsports_ar.gif"); $this->mcChannelMap["9"] = array("19","19","23","www.espndeportes.com","ESPN","http://www.lyngsat-logo.com/icon/tv/ee/espn.gif"); $this->mcChannelMap["43"] = array("20","","","multideporte.nourl.tv","Multideporte",""); $this->mcChannelMap["34"] = array("21","27","32","www.isat.tv","I.Sat","http://www.lyngsat-logo.com/icon/tv/ii/i_sat.gif"); $this->mcChannelMap["13"] = array("22","23","29","www.space.com.ar","Space","http://www.lyngsat-logo.com/icon/tv/ss/space_arg.gif"); $this->mcChannelMap["4"] = array("23","25","28","www.cinecanal.com","Cinecanal","http://www.lyngsat-logo.com/icon/tv/cc/cinecanal_este.gif"); $this->mcChannelMap["60"] = array("24","24","","www.volver.com.ar","Volver","http://www.lyngsat-logo.com/icon/tv/vv/volver.gif"); $this->mcChannelMap["6"] = array("25","28","","www.filmzone.cc","The Film Zone","http://www.lyngsat-logo.com/icon/tv/ff/filmzone.gif"); $this->mcChannelMap["52"] = array("26","26","30","www.tntla.com","TNT","http://www.lyngsat-logo.com/icon/tv/tt/tnt_sam.gif"); $this->mcChannelMap["30"] = array("27","22","35","www.hallmarkchannel.tv","Hallmark","http://www.lyngsat-logo.com/icon/tv/hh/hallmark_channel.gif"); $this->mcChannelMap["27"] = array("28","29","27","www.mundofox.com","FOX","http://www.lyngsat-logo.com/icon/tv/ff/fox_tv.gif"); $this->mcChannelMap["8"] = array("29","33","77","www.canalaxn.com","AXN","http://www.lyngsat-logo.com/icon/tv/aa/axn.gif"); $this->mcChannelMap["80"] = array("30","35","34","www.europaeuropa.tv","Europa, Europa",""); $this->mcChannelMap["14"] = array("31","30","41","www.canalsony.com","Sony","http://www.lyngsat-logo.com/icon/tv/ss/set_latin.gif"); $this->mcChannelMap["57"] = array("32","36","65","www.retro.tv","Retro","http://www.lyngsat-logo.com/icon/tv/rr/retro.gif"); $this->mcChannelMap["61"] = array("33","31","33","www.warnerchannel.net","Warner Channel","http://www.lyngsat-logo.com/icon/tv/ww/warner_channel_us.gif"); $this->mcChannelMap["58"] = array("34","32","31","www.universalchannel.tv","Universal Channel","http://www.lyngsat-logo.com/icon/tv/uu/universal_channel.gif"); $this->mcChannelMap["33"] = array("35","55","51","www.infinito.com","Infinito","http://www.lyngsat-logo.com/icon/tv/ii/infinito.gif"); $this->mcChannelMap["73"] = array("35","","60","www.venus.com.ar","Venus","http://www.lyngsat-logo.com/icon/tv/vv/venus_ar.gif"); $this->mcChannelMap["7"] = array("36","53","48","www.animalplanetlatino.com","Animal Planet","http://www.lyngsat-logo.com/icon/tv/aa/animal_planet.gif"); $this->mcChannelMap["23"] = array("37","52","43","www.discoverychannellatino.com","Discovery Channel","http://www.lyngsat-logo.com/icon/tv/dd/discovery.gif"); $this->mcChannelMap["46"] = array("38","51","13","www.natgeolatino.com","National Geographic","http://www.lyngsat-logo.com/icon/tv/nn/natgeochannel.gif"); $this->mcChannelMap["44"] = array("39","38","47","www.aeweb.tv","A&E","http://www.lyngsat-logo.com/icon/tv/aa/ae_tv.gif"); $this->mcChannelMap["178"] = array("40","34","25","www.canalfx.tv","FX","http://www.lyngsat-logo.com/icon/tv/ff/fx_br.gif"); $this->mcChannelMap["11"] = array("41","46","52","elgourmet.com","elgourmet.com","http://www.lyngsat-logo.com/icon/tv/ee/el_gourmet.gif"); $this->mcChannelMap["59"] = array("42","45","53","www.utilisima.com.ar","Utilísima","http://www.lyngsat-logo.com/icon/tv/uu/utilisima_satelital.gif"); $this->mcChannelMap["84"] = array("43","48","76","www.cosmopolitan.tv","Cosmopolitan",""); $this->mcChannelMap["36"] = array("44","67","62","www.mtvla.com","MTV","http://www.lyngsat-logo.com/icon/tv/mm/mtv.gif"); $this->mcChannelMap["42"] = array("45","68","63","www.muchla.com","MuchMusic","http://www.lyngsat-logo.com/icon/tv/mm/muchmusic.gif"); $this->mcChannelMap["135"] = array("46","","","www.rockandpoptv.com.ar","Rock&Pop",""); $this->mcChannelMap["181"] = array("47","70","61","www.vh1la.com","VH1","http://www.lyngsat-logo.com/icon/tv/vv/vh1.gif"); $this->mcChannelMap["26"] = array("48","49","50","www.eonlinelatino.com","E! Entertainment","http://www.lyngsat-logo.com/icon/tv/ee/e_entertainment_tv.gif"); $this->mcChannelMap["19"] = array("49","50","59","canalrural.nourl.tv","Canal Rural","http://www.lyngsat-logo.com/icon/tv/rr/rural_satelital_arg.gif"); $this->mcChannelMap["50"] = array("50","","64","www.international.rai.it","RAI","http://www.lyngsat-logo.com/icon/tv/rr/rai_int.gif"); $this->mcChannelMap["54"] = array("51","","66","www.rtve.es","TVE","http://www.lyngsat-logo.com/icon/tv/tt/tve_int.gif"); $this->mcChannelMap["15"] = array("52","74","","galiciatv.nourl.tv","Galicia TV",""); $this->mcChannelMap["18"] = array("53","73","42","canaldelasestrella.nourl.tv","El Canal de las Estrellas","http://www.lyngsat-logo.com/icon/tv/cc/canal_estrellas_mx.gif"); $this->mcChannelMap["51"] = array("54","57","69","www.thc.tv","The History Channel","http://www.lyngsat-logo.com/icon/tv/hh/history_channel.gif"); $this->mcChannelMap["72"] = array("55","","59","www.playboytvla.com","Playboy","http://www.lyngsat-logo.com/icon/tv/pp/playboy_latin_america.gif"); $this->mcChannelMap["5"] = array("55","56","","www.filmandarts.tv","Film & Arts","http://www.lyngsat-logo.com/icon/tv/ff/filmarts.gif"); $this->mcChannelMap["48"] = array("56","58","","www.peopleandartslatino.com","People+Arts","http://www.lyngsat-logo.com/icon/tv/pp/people_arts_sam.gif"); $this->mcChannelMap["40"] = array("57","13","","metro.nourl.tv","Metro",""); $this->mcChannelMap["67"] = array("58","7","70","www.cnnenespanol.com","CNN en español","http://www.lyngsat-logo.com/icon/tv/cc/cnn.gif"); $this->mcChannelMap["68"] = array("59","4","","www.cronicatv.com.ar","Crónica TV","http://www.lyngsat-logo.com/icon/tv/cc/cronica_tv.gif"); $this->mcChannelMap["71"] = array("60","3","26","www.26noticias.com.ar","Canal 26","http://www.lyngsat-logo.com/icon/tv/cc/canal26_ar.gif"); $this->mcChannelMap["156"] = array("61","2","46","america24.america2.com.ar","América 24",""); $this->mcChannelMap["31"] = array("62","","54","www.hbo-la.tv","HBO","http://www.lyngsat-logo.com/icon/tv/hh/hbo.gif"); $this->mcChannelMap["32"] = array("63","","55","hboplus.hbo-la.tv","HBO Plus","http://www.lyngsat-logo.com/icon/tv/hh/hbo_plus.gif"); $this->mcChannelMap["21"] = array("64","","56","www.cinemax-la.tv","Cinemax","http://www.lyngsat-logo.com/icon/tv/cc/cinemax.gif"); $this->mcChannelMap["41"] = array("65","","57","www.moviecity.com","Movie City","http://www.lyngsat-logo.com/icon/tv/mm/moviecity_oeste.gif"); $this->mcChannelMap["3"] = array("66","","58","cinecanal2.cinecanal.com","Cinecanal 2","http://www.lyngsat-logo.com/icon/tv/cc/cinecanal2.gif"); $this->mcChannelMap["70"] = array("67","","71","www.cnn.com","CNN Internacional","http://www.lyngsat-logo.com/icon/tv/cc/cnn_international.gif"); $this->mcChannelMap["53"] = array("68","","80","www.tv5.org","TV 5 Francia","http://www.lyngsat-logo.com/icon/tv/tt/tv5_monde_amerique_latine.gif"); $this->mcChannelMap["22"] = array("69","78","74","www.dw-world.de","Deutsche Welle","http://www.lyngsat-logo.com/icon/tv/dd/dw_tv.gif"); $this->mcChannelMap["197"] = array("70","","","redeglobo.globo.com","O´Globo","http://www.lyngsat-logo.com/icon/tv/gg/globo_int.gif"); $this->mcChannelMap["82"] = array("71","","","www.bbc.co.uk","BBC","http://www.lyngsat-logo.com/icon/tv/bb/bbc_world.gif"); $this->mcChannelMap["198"] = array("71","","","senadotv.nourl.tv","El Senado TV",""); $this->mcChannelMap["12"] = array("72","71","79","www.tangocity.com","Solo Tango",""); $this->mcChannelMap["17"] = array("73","59","83","www.canalaonline.com","Canal (á)","http://www.lyngsat-logo.com/icon/tv/cc/canal_a_ar.gif"); $this->mcChannelMap["65"] = array("74","47","67","www.ftvla.com","Fashion TV","http://www.lyngsat-logo.com/icon/tv/ff/fashion_tv.gif"); $this->mcChannelMap["35"] = array("75","66","78","www.animax-la.com","Animax","http://www.lyngsat-logo.com/icon/tv/aa/animax.gif"); $this->mcChannelMap["200"] = array("77","79","2","ewtn.nourl.tv","EWTN",""); $this->mcChannelMap["218"] = array("77","","","nuevaimagen.nourl.tv","Nueva Imagen",""); $this->mcChannelMap["24"] = array("78","54","44","salud.discovery.com","Discovery Home & Health","http://www.lyngsat-logo.com/icon/tv/dd/discovery_home_health.gif"); $this->mcChannelMap["201"] = array("79","","72","argentinisima.nourl.tv","Argentinisima",""); $this->mcChannelMap["202"] = array("80","80","","www.ciudadabiertatv.gov.ar","Ciudad Abierta",""); $this->mcChannelMap["90"] = array("20","20","","www.discoverytl.com","Discovery Travel & Living","http://www.lyngsat-logo.com/icon/tv/dd/discovery_travel_living.gif"); $this->mcChannelMap["116"] = array("75","75","","www.tvchile.com","TV Chile","http://www.lyngsat-logo.com/icon/tv/tt/tvnacionalchile.gif"); $this->mcChannelMap["410"] = array("06","06","","www.encuentro.com","Encuentro",""); $this->mcChannelMap["242"] = array("37","37","","www.tcm.com","TCM - Classic Hollywood","http://www.lyngsat-logo.com/icon/tv/tt/tcm.gif"); } function transliteration ($inputString) { $str = strtolower($inputString); $badChars = array("|á|","|é|","|í|","|ó|","|ú|","|ñ|"); $goodChars = array("a","e","i","o","u","n"); $str = preg_replace($badChars,$goodChars,$str); $str = preg_replace("|[^a-z0-9]|","",$str); return $str; } function set_initial_cookie() { $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookieBuscadorMulticanal"); curl_setopt($ch, CURLOPT_URL,"http://www.buscadormulticanal.com.ar/index.php"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727"); ob_start(); // Prevent output curl_exec ($ch); ob_end_clean(); // End preventing output curl_close ($ch); unset($ch); } function file_url_get_contents($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookieBuscadorMulticanal"); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727"); curl_setopt($ch, CURLOPT_REFERER, "http://www.buscadormulticanal.com.ar/index.php"); $ret = curl_exec($ch); curl_close ($ch); return $ret; } } ?>