diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-12-01 14:39:59 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-12-01 14:39:59 +0100 |
commit | bab6955557830c25e59433a9127c5f3b4ac1b387 (patch) | |
tree | 9aa4d8a78152554c5ebf5607f19c8b6905d4a205 /PLUGINS/src/sky/getskyepg.pl | |
parent | 3e0659a10aec259f7e298ce2f577d900b2c3eb41 (diff) | |
download | vdr-bab6955557830c25e59433a9127c5f3b4ac1b387.tar.gz vdr-bab6955557830c25e59433a9127c5f3b4ac1b387.tar.bz2 |
Made the getskyepg.pl script of the 'sky' plugin send a user agent message to the server
Diffstat (limited to 'PLUGINS/src/sky/getskyepg.pl')
-rwxr-xr-x | PLUGINS/src/sky/getskyepg.pl | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/PLUGINS/src/sky/getskyepg.pl b/PLUGINS/src/sky/getskyepg.pl index 26dbc0a0..d5819811 100755 --- a/PLUGINS/src/sky/getskyepg.pl +++ b/PLUGINS/src/sky/getskyepg.pl @@ -8,7 +8,7 @@ # # See the README file for copyright information and how to reach the author. # -# $Id: getskyepg.pl 1.4 2006/01/08 10:21:32 kls Exp $ +# $Id: getskyepg.pl 1.5 2006/12/01 14:38:00 kls Exp $ use Getopt::Std; use Time::Local; @@ -21,18 +21,29 @@ Options: -c filename channel config file name (default: channels.conf.sky -p port SVDRP port number (default: 2001) -S source channel source (default: S28.2E) -D days days to get EPG for (1..7, default: 2) + -U use this if your version of 'wget' doesn't support -U }; -die $Usage if (!getopts("c:d:D:hp:S:") || $opt_h); +die $Usage if (!getopts("c:d:D:hp:S:U") || $opt_h); $Conf = $opt_c || "channels.conf.sky"; $Dest = $opt_d || "localhost"; $Port = $opt_p || 2001; $Source = $opt_S || "S28.2E"; $Days = $opt_D || 2; +$User = $opt_U; + +# See "Rules for using this data" on http://bleb.org/tv/data/listings. +# In case you modify this script in a way that changes its behavior +# towards the www.bleb.org website, please replace 'vdrbugs@cadsoft.de' +# with your own email address! That way Andrew Flegg <andrew@bleb.org>, +# who runs that web site, can contact you in case of problems. +$IDENT = "VDR::getskyepg.pl, http://www.cadsoft.de/vdr - vdrbugs\@cadsoft.de"; +$GAP = 2; $SkyWebPage = "www.bleb.org/tv/data/listings"; $WGET = "/usr/bin/wget -q -O-"; +$WGET .= " -U '$IDENT'" unless $User; $LOGGER = "/usr/bin/logger -t SKYEPG"; $DST = -3600; # Daylight Saving Time offset @@ -76,7 +87,8 @@ sub GetPage my $channel = shift; my $day = shift; $day--; - my $url = "$SkyWebPage/$day/$channel.xml"; + my $url = "http://$SkyWebPage/$day/$channel.xml"; + $url .= "?$IDENT" if $User; Log("reading $url"); my @page = split("\n", `$WGET '$url'`); Log("received " . ($#page + 1) . " lines"); @@ -174,6 +186,7 @@ sub GetEpgData $data .= $line; } } + sleep($GAP); } SVDRPsend("c"); Log("generated $numEvents EPG events"); |