/*************************************************************************
* Copyright 2009/2010/2011 Ralph Spitzner (rasp@spitzner.org)
*
* This file is part of v2Yahdr.
*
* v2Yahdr is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Yahdr is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with v2Yahdr. If not, see .
**************************************************************************/
/**************************************************************************
Files in this directory 'talk' to v2Yahdr via http.
Put them somewhere where only your localnet hast acess to, preferably
the same host as v2Yahdr runs on, as we then can simply connect to
'localhost'.
Some sort of storage for eg. a 'Favourites' list is needed,
sqlite comes in handy here ;-)
These files are the part you should modify to suit your need's,
if you don't want to poke around the C-source.
As I'm not a php/html/css genius my example files here will look ugly
and/or clumsy at best, feel free to help :-)
***************************************************************************/
include "globs.php";
$fav = file("./favourites.txt",FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
function set_channel($name)
{
global $yserv;
echo "call:$yserv/tuneto=$name";
$f = fopen("$yserv/tuneto=$name","r");
if($f == 0)
return;
$res = stream_get_contents($f);
echo "result: ".$res." ";
fclose($f);
}
function get_nownext($name)
{
global $yserv;
$f = fopen("$yserv/nownext=$name","r");
if($f == 0)
{
echo "URLopen failed @ get_nownext() ";
return;
}
$blob = stream_get_contents($f);
$recs = explode("@NR@",$blob);
return $recs;
}
?>