Thanks! Just released a new version of the script.Skekso wrote:Getting some funky output for country on web series. TCL 8.6 and eggdrop 1.6.21
<bot> Show: Bloodline " Network: Netflix " Genre: Drama Family
<bot> Premiered: 2015-03-20 (name {United States} code US timezone America/New_York) " Status: Running " URL: http://www.tvmaze.com/shows/1372/bloodline
<bot> Last: S01E13 aired 2015-03-20
Code: Select all
[04:01pm] <Bot> Show: Heroes Reborn " Network: NBC " Genre: Drama Action Science-Fiction
[04:01pm] <Bot> Premiered: 2015-09-24 " Status: Running " URL: http://www.tvmaze.com/shows/1415/heroes-reborn
[04:01pm] <Bot> Previous: S01E03 aired 2015-10-01 " Next: S01E04 airs 2015-10-08 at 08:00 PM EDT
Code: Select all
[04:06pm] <user> !last archer (2009)
[04:06pm] <Bot> user, there was an http error: ( 404 ) ok
Code: Select all
$ echo "puts [info tclversion]" | tclsh
8.6
$ echo "puts [info patchlevel]" | tclsh
8.6.1
$ echo "puts [package require json]" | tclsh
1.1.2
Code: Select all
.tcl encoding names
Tcl: cp860 cp861 cp862 cp863 cp864 tis-620 cp865 cp866 gb2312-raw gb12345 cp950 cp949 cp869 dingbats ksc5601 macCentEuro cp874 macUkraine gb2312 jis0201 euc-cn euc-jp iso8859-10 macThai jis0208 iso2022-jp macIceland iso2022 iso8859-13 iso8859-14 jis0212 cp737 iso8859-15 iso8859-16 big5 euc-kr macRomania macTurkish gb1988 iso2022-kr macGreek cp437 ascii macRoman iso8859-1 iso8859-2 iso8859-3 koi8-r macCroatian iso8859-4 ebcdic iso8859-5 cp1250 macCyrillic iso8859-6 cp1251 macDingbats cp1252
Tcl: koi8-u iso8859-7 iso8859-8 cp1253 cp1254 iso8859-9 cp1255 cp850 cp1256 cp932 identity cp852 cp1257 cp1258 macJapan shiftjis utf-8 cp936 cp855 cp775 symbol unicode cp857
Thank you for your complimentsphilodox wrote:first of all thanks for a great script.
is it possible to request support for themes for use with other sitebot script like ie. pzs-ng and for easy change of bot output to channel?
Code: Select all
<?php
$file = fopen("tv.txt", "w") or die("Unable to open file!");
$today = date("Y-m-d");
$mychans = array("AMC","The CW", "FOX","NBC","ABC","FX","SyFy");
$url = "http://api.tvmaze.com/schedule?date=" . $today;
$json = file_get_contents($url);
$data = json_decode($json,true);
$last = count($data) - 1; // might need later
$title = "\002\00304Full Schedule For \00308" . $today . "\r\n";
$chanlist = "Channels Listed - " . join(" ",$mychans) . "\r\n";
fwrite ($file, $title);
fwrite ($file, $chanlist);
foreach ($data as $kkey ) {
$season = $kkey['season'];
$ep = $kkey['number'];
$showname = $kkey['show']['name'];
$airs = $kkey['airtime'];
$episodename = $kkey['name'];
$channel = $kkey['show']['network']['name'];
if (in_array($channel, $mychans)){
$myline = $airs . " - " . $channel . " - " . $showname . " - Season " . $season . " - Episode " . $ep . "\r\n";
fwrite($file, $myline);
}
}
fclose($file);
?>
Code: Select all
bind pub - "!today" today
proc today {chan args} {
set fp [open "tv.txt" r]
set file_data [read $fp]
close $fp
set data [split $file_data "\n"]
foreach line $data {
putserv "PRIVMSG #channel : $line"
}
}