| View previous topic :: View next topic |
| Author |
Message |
mark_OH Guest
|
Posted: Tue Sep 09, 2003 3:05 am Post subject: !tv5.3 doesn´t work anymore :/ |
|
|
Hi there,
i use the !tv script version 5.3 of Giggel, it worked fine yes but for some weeks it doesn´t ....
my bot returns no result, is like dead, when i do a !tv ard 20 1 for example...
Anyone got any ideas!?
Here´s the source...
http://www.stud.uni-karlsruhe.de/~udkz/new/irc/script/tv_v5.3.tcl.gz
Greetz MARK_oh |
|
| Back to top |
|
 |
mark_OH Guest
|
Posted: Tue Sep 09, 2003 3:25 am Post subject: |
|
|
| Code: |
#####################################################################
### ###
### TV-Programm v2.3 By Giggel (giggel@gmx.de) ###
### ###
#####################################################################
### Infos, Updates, Bugreports unter: ###
### http://www.stud.uni-karlsruhe.de/~udkz/shared/script.html ###
#####################################################################
#
# This script is made for all the lazy guys who do NOT have a TV-Program.
# Its looking up the actual Program at www.tvspielfilm.de and posts the
# answer (slightly cutted) to the channel, query or dcc-chat.
# I'm sure it has thousands of bugs, if you find one: TELL ME PLEAAAASE :)
# Also tell me, if you found a bug and fixed it.
#
############
# Examples:
# ---------
# !tv ard, !tv ard 20, !tv ard 20 3
# ^^^ ^^ ^
# Programm on ARD at 2000 hours tomorrow
# !tv ard,zdf,sat1 !tv ard,zdf,sat1 18,22
# ^^^^^^^^^^^^ ^^^^^
# Programm on ARD,ZDF and Sat1 between 1800 and 2200 hours
#
########
# ToDo:
# -----
# - improving
# - bugfixing ;)
##############
### Syntax ###
##############
#
# -------public-------
# !tv Sender[,Sender..] Stunde[,Stunde] Tag
#
# -------query--------
# /msg bot !tv Sender[,Sender..] Stunde[,Stunde] Tag
# /msg bot tv Sender[,Sender..] Stunde[,Stunde] Tag
#
# -------dcc-chat-----
# .tv Sender[,Sender..] Stunde[,Stunde] Tag
#
# known Programs: ARD, ZDF, RTL, Sat1, Pro7, Kabel1,
# RTL2, SuperRTL, Vox, 3Sat, Arte, TM3, N3, WDR, Bayern, BRalpha, Hessen,
# SWR, MDR, ORB, Eurosport, DSF, Kinderkanal, Cartoon, TNT, Berlin1,
# TVMuenchen, TVBerlin, Hamburg1, DW TV, Phoenix, Viva, Viva2, MTV, VH1,
# NTV, CNN, Euronews, ORF1, ORF2, SF1, SF2, NL1, NL2, NL3, NBC, BBCWorld,
# France3, TV5, TRT,Premiere, Sportsworld, Familyworld, Heimatkanal,
# Filmpalast, Classica, Seasons, Bluechannel"
#
# Stunde is just a number from 01 till 24
# If no value is given the actual hour is taken
# You can also specify two hours, i.e. 10,15. This makes the script to look
# for everything between 1000 and 1500
#
# Tag is another number from 0 till 7, where 0 means: today (default)
# 1 is tomorrow and so on ..
################
### Settings ###
################
#set channels that this script should work in
set tv(chans) "#allgaeu #giga"
#userflag needed to use the script
#type "-" if the user don't need to have a botflag
set tv(flag) "-"
########################################################
### You shouldn't change anything of the stuff below ###
########################################################
set tv(help) "Usage: \002PUB:\002 !tv Sender(,Sender..) Stunde(,Stunde) Tag -\
\002DCC:\002 .tv Sender(,Sender..) Stunde(,Stunde) Tag -\
\022MSG:\022 /msg bot !tv Sender(,Sender..) Stunde(,Stunde) Tag"
set tv(sender) "Sender: ARD, ZDF, RTL, Sat1, Pro7, Kabel1,\
RTL2, SuperRTL, Vox, 3Sat, Arte, TM3, N3, WDR, Bayern, BRalpha, Hessen,\
SWR, MDR, ORB, Eurosport, DSF, Kinderkanal, Cartoon, TNT, Berlin1,\
TVMuenchen, TVBerlin, Hamburg1, DW TV, Phoenix, Viva, Viva2, MTV, VH1,\
NTV, CNN, Euronews, ORF1, ORF2, SF1, SF2, NL1, NL2, NL3, NBC, BBCWorld,\
France3, TV5, TRT, Premiere, Sportsworld, Familyworld, Heimatkanal,\
Filmpalast, Classica, Seasons, Bluechannel"
set tv(tag) "Tag muss eine Zahl zwischen 0 und 7 sein, wobei folgende Bedeutung gilt:\
0 = heute, 1 = morgen usw.."
set tv(server) "www.tvspielfilm.de"
set tv(script) "/programm/tvplaner"
set tv(chans) [string tolower $tv(chans)]
set replyto -
proc eval_sender {in} {
set tmp ,
foreach tmp2 [split $in ,] {
switch [string tolower $tmp2] {
"haupt" { return "1,2,3,4,5,6,7,9" }
"ard" { set tmp "$tmp,1" }
"zdf" { set tmp "$tmp,2" }
"rtl" { set tmp "$tmp,3" }
"sat1" { set tmp "$tmp,4" }
"pro7" { set tmp "$tmp,5" }
"kabel1" { set tmp "$tmp,6" }
"rtl2" { set tmp "$tmp,7" }
"superrtl" { set tmp "$tmp,8" }
"vox" { set tmp "$tmp,9" }
"3sat" { set tmp "$tmp,10" }
"arte" { set tmp "$tmp,109" }
"tm3" { set tmp "$tmp,110" }
"n3" { set tmp "$tmp,101" }
"wdr" { set tmp "$tmp,100" }
"bayern" { set tmp "$tmp,102" }
"bralpha" { set tmp "$tmp,124" }
"hessen" { set tmp "$tmp,103" }
"swr" { set tmp "$tmp,104" }
"mdr" { set tmp "$tmp,105" }
"orb" { set tmp "$tmp,106" }
"eurosport" { set tmp "$tmp,107" }
"dsf" { set tmp "$tmp,108" }
"kinderkanal" { set tmp "$tmp,122" }
"cartoon" { set tmp "$tmp,123" }
"tnt" { set tmp "$tmp,123" }
"berlin1" { set tmp "$tmp,115" }
"tvmuenchen" { set tmp "$tmp,119" }
"tvberlin" { set tmp "$tmp,120" }
"hamburg1" { set tmp "$tmp,116" }
"dwtv" { set tmp "$tmp,118" }
"phoenix" { set tmp "$tmp,125" }
"viva" { set tmp "$tmp,112" }
"viva2" { set tmp "$tmp,113" }
"mtv" { set tmp "$tmp,111" }
"vh-1" { set tmp "$tmp,114" }
"ntv" { set tmp "$tmp,170" }
"cnn" { set tmp "$tmp,172" }
"euronews" { set tmp "$tmp,171" }
"premiere" { set tmp "$tmp,11" }
"sportsworld" { set tmp "$tmp,240" }
"familyworld" { set tmp "$tmp,217" }
"heimatkanal" { set tmp "$tmp,208" }
"filmpalast" { set tmp "$tmp,209" }
"classica" { set tmp "$tmp,219" }
"seasons" { set tmp "$tmp,212" }
"bluechannel" { set tmp "$tmp,214" }
"orf1" { set tmp "$tmp,151" }
"orf2" { set tmp "$tmp,152" }
"sf1" { set tmp "$tmp,153" }
"sf2" { set tmp "$tmp,162" }
"nl1" { set tmp "$tmp,154" }
"nl2" { set tmp "$tmp,155" }
"nl3" { set tmp "$tmp,156" }
"nbc" { set tmp "$tmp,174" }
"bbcworld" { set tmp "$tmp,173" }
"france3" { set tmp "$tmp,159" }
"tv5" { set tmp "$tmp,160" }
"trt" { set tmp "$tmp,161" }
}
}
if {$tmp == ","} {
return "NOPE"
} else {
return [string range $tmp 2 [string length $tmp]]
}
}
proc eval_stunde {in} {
set ok 1
set tmp2 [split $in ,]
foreach tmp [split $in ,] {
if {[string first $tmp "0 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23"] == -1} {
set ok 0
}
}
if {$ok == 1} {
return $in
} else {
return "NOPE"
}
}
proc eval_tag {in} {
if {[string first $in "0 0 1 2 3 4 5 6 7"] > 0} {
return $in
} else {
return "NOPE"
}
}
proc www_answer {sock query where who} {
global tv replyto
if {![info exist tv($sock)]} {
set ind [gets $sock]
puts $sock "$query "
lappend tv($sock) $ind
fconfigure $sock -blocking no -buffering full -buffersize 4096
putlog "getting html-Page"
} else {
lappend tv($sock) [read $sock 4096]
}
if {[eof $sock]} {
close $sock
putlog "scanning html-Page $sock"
set answer [join $tv($sock) \n]
set answered 0
if {[string first "Leider wurden keine Sendungen mit den von Ihnen festgelegten Vorgaben gefunden" $answer] > 0} {
set answer "Leider wurden keine Sendungen mit den von Ihnen\
festgelegten Vorgaben gefunden.Bitte erweitern Sie Ihre Auswahlkriterien."
} else {
while {[string first "/programm/sendung/" $answer]>0} {
set answered 1
set answer [string range $answer\
[string first "/programm/sendung/" $answer]\
[string length $answer] ]
set url "http://$tv(server)[string range $answer 0\
[expr [string first "><font" $answer]-2] ]"
set tmpanswer [string range $answer\
[expr [string first "<b>" $answer]+3]\
[expr [string first "</a><br></b></font>" $answer]-1] ]
set bisanswer [string range $answer\
[expr [string first "text" $answer]+6]\
[expr [string first "Uhr" $answer]+2] ]
regsub -all "\n" $tmpanswer " " tmpanswer
regsub -all "\n" $bisanswer " " bisanswer
set answer [string range $answer\
[expr [string first "/programm/sendung/" $answer]+20]\
[string length $answer] ]
set answer [string range $answer\
[expr [string first "/programm/sendung/" $answer]+20]\
[string length $answer] ]
switch $where {
"server" {
puthelp "PRIVMSG $who :${replyto}: ${tmpanswer} | ${bisanswer}"
puthelp "NOTICE ${replyto} :Details: $url"
}
"dcc" { putdcc $who "${tmpanswer} | ${bisanswer} - Details: $url" }
"msg" {
puthelp "PRIVMSG ${replyto} :${tmpanswer} | ${bisanswer}"
puthelp "PRIVMSG ${replyto} :Details: $url"
}
}
}
}
if {$answered == 0} {
switch $where {
"server" { puthelp "NOTICE ${replyto} :Nix gefunden, oder Fehler" }
"dcc" { putdcc $who "Nix gefunden, oder Fehler" }
"msg" { puthelp "PRIVMSG ${replyto} :Nix gefunden, oder Fehler" }
}
}
unset tv($sock)
}
}
proc pub_transl {ni uh ha ch text} {
global tv replyto
if {![string match "*[string tolower "$ch"]*" "$tv(chans)"]} {
return 0
}
if {[llength $text] < 1} {
puthelp "NOTICE ${ni} :$tv(help)"
puthelp "NOTICE ${ni} :$tv(sender)"
puthelp "NOTICE ${ni} :$tv(tag)"
return 1
}
if {[llength $text] == 1} {
set query "?zeit=[clock format [unixtime] -format %H]&sparte=&sender=[eval_sender $text]&tag=0&eingang=ok"
if {[string first "NOPE" $query] > 0} {
# uncomment the next two lines and comment the following 2, if you want the errormsgs posted to the channel
# and not via notice to nick
# puthelp "PRIVMSG $ch :$ni: Diesen Sender kenne ich nicht"
# puthelp "PRIVMSG $ch :$ni: $tv(sender)"
puthelp "NOTICE ${ni} :Diesen Sender kenne ich nicht"
puthelp "NOTICE ${ni} :$tv(sender)"
return 1
}
}
if {[llength $text] == 2} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set query "?zeit=[eval_stunde $std]&sparte=&sender=[eval_sender $sender]&tag=0&eingang=ok"
if {[string first "NOPE" $query] > 0} {
# uncomment the next line and comment the following, if you want the errormsgs posted to the channel
# and not via notice to nick
# puthelp "PRIVMSG $ch :$ni Sender oder Stunde falsch angegeben"
puthelp "NOTICE ${ni} :Sender oder Stunde falsch angegeben"
return 1
}
}
if {[llength $text] == 3} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set tag [lindex $text 2]
set query "?zeit=[eval_stunde $std]&sparte=&sender=[eval_sender $sender]&tag=[eval_tag $tag ]&eingang=ok"
if {[string first "NOPE" $query] > 0} {
# uncomment the next three lines and comment the following 3, if you want the errormsgs posted to the channel
# and not via notice to nick
# puthelp "PRIVMSG $ch :$ni Sender, Stunde oder Tag falsch angegeben"
# puthelp "PRIVMSG $ch :$ni $tv(sender)"
# puthelp "PRIVMSG $ch :$ni $tv(tag)"
puthelp "NOTICE ${ni} :Sender, Stunde oder Tag falsch angegeben"
puthelp "NOTICE ${ni} :$tv(sender)"
puthelp "NOTICE ${ni} :$tv(tag)"
return 1
}
}
if {[catch {set sock [socket -async $tv(server) 80]} emsg]} {
putlog "TVP: Error($emsg)"
puthelp "PRIVMSG $ch :${ni}: Error($emsg)"
return 1
}
# puthelp "PRIVMSG $ch :Suche ..."
puthelp "NOTICE ${ni} :Suche ..."
set replyto $ni
fconfigure $sock -blocking 0 -buffering line
fileevent $sock readable "www_answer $sock $query server $ch"
putlog "<<${ni}>> TV-Suche: $text"
puts $sock "GET $tv(script)$query"
flush $sock
return 1
}
proc dcc_transl {ha idx text} {
global tv replyto
if {[llength $text] < 1} {
putdcc $idx "$tv(help)"
putdcc $idx "$tv(sender)"
putdcc $idx "$tv(tag)"
return 1
}
if {[llength $text] == 1} {
set query "?zeit=[clock format [unixtime] -format %H]&sparte=&sender=[eval_sender $text]&tag=0&eingang=ok"
if {[string first "NOPE" $query] > 0} {
putdcc $idx "Diesen Sender kenne ich nicht"
putdcc $idx "$tv(sender)"
return 1
}
}
if {[llength $text] == 2} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set query "?zeit=[eval_stunde $std]&sparte=&sender=[eval_sender $sender]&tag=0&eingang=ok"
if {[string first "NOPE" $query] > 0} {
putdcc $idx "Sender oder Stunde falsch angegeben"
return 1
}
}
if {[llength $text] == 3} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set tag [lindex $text 2]
set query "?zeit=[eval_stunde $std]&sparte=&sender=[eval_sender $sender]&tag=[eval_tag $tag ]&eingang=ok"
if {[string first "NOPE" $query] > 0} {
putdcc $idx "Sender, Stunde oder Tag falsch angegeben"
putdcc $idx "$tv(sender)"
putdcc $idx "$tv(tag)"
return 1
}
}
if {[catch {set sock [socket -async $tv(server) 80]} emsg]} {
putlog "TVP: Error($emsg)"
putdcc $idx "TVP: Error($emsg)"
return 1
}
fconfigure $sock -blocking 0 -buffering line
set replyto $ha
fileevent $sock readable "www_answer $sock $query dcc $idx"
puts $sock "GET $tv(script)$query\n"
flush $sock
return 1
}
proc msg_transl {ni uh ha text} {
global tv replyto
if {[llength $text] < 1} {
puthelp "PRIVMSG ${ni} :$tv(help)"
puthelp "PRIVMSG ${ni} :$tv(sender)"
puthelp "PRIVMSG ${ni} :$tv(tag)"
return 1
}
if {[llength $text] == 1} {
set query "?zeit=[clock format [unixtime] -format %H]&sparte=&sender=[eval_sender $text]&tag=0&eingang=ok"
if {[string first "NOPE" $query] > 0} {
puthelp "PRIVMSG ${ni} :Diesen Sender kenne ich nicht"
puthelp "PRIVMSG ${ni} :$tv(sender)"
return 1
}
}
if {[llength $text] == 2} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set query "?zeit=[eval_stunde $std]&sparte=&sender=[eval_sender $sender]&tag=0&eingang=ok"
if {[string first "NOPE" $query] > 0} {
puthelp "PRIVMSG ${ni} :Sender oder Stunde falsch angegeben"
return 1
}
}
if {[llength $text] == 3} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set tag [lindex $text 2]
set query "?zeit=[eval_stunde $std]&sparte=&sender=[eval_sender $sender]&tag=[eval_tag $tag ]&eingang=ok"
if {[string first "NOPE" $query] > 0} {
puthelp "PRIVMSG ${ni} :Sender, Stunde oder Tag falsch angegeben"
puthelp "PRIVMSG ${ni} :$tv(sender)"
puthelp "PRIVMSG ${ni} :$tv(tag)"
return 1
}
}
if {[catch {set sock [socket -async $tv(server) 80]} emsg]} {
putlog "TVP: Error($emsg)"
puthelp "PRIVMSG ${ni} :Error($emsg)"
return 1
}
puthelp "PRIVMSG ${ni} :Suche ..."
set replyto $ni
fconfigure $sock -blocking 0 -buffering line
fileevent $sock readable "www_answer $sock $query msg -"
putlog "<<${ni}>> TV-Suche: $text"
puts $sock "GET $tv(script)$query"
flush $sock
return 1
}
bind pub $tv(flag)|$tv(flag) !tv pub_transl
bind msg $tv(flag)|$tv(flag) !tv msg_transl
bind dcc -|- tv dcc_transl
putlog "TV-Program v2.0 by Giggel loaded for $tv(chans).."
|
|
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Tue Sep 09, 2003 8:10 am Post subject: |
|
|
Could be they have changed the way the website works that your bot retrieves the info from. or the website is down or has moved? i would guess at the first tho.
2/3 of the way down the script theres a proc commented out
| Code: | # uncomment the next three lines and comment the following 3, if you want the errormsgs posted to the channel
|
uncomment the next 3 lines
| Code: | # puthelp "PRIVMSG $ch :$ni Sender, Stunde oder Tag falsch angegeben"
# puthelp "PRIVMSG $ch :$ni $tv(sender)"
# puthelp "PRIVMSG $ch :$ni $tv(tag)"
|
and see what errors it gives you perhaps?
hope this helps
^DooM^ _________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
GodOfSuicide Master

Joined: 17 Jun 2002 Posts: 463 Location: Austria
|
Posted: Tue Sep 09, 2003 10:06 am Post subject: |
|
|
german for ^Doom^ys
| Quote: |
# puthelp "PRIVMSG $ch :$ni Sender, Stunde oder Tag falsch angegeben"
# puthelp "PRIVMSG $ch :$ni $tv(sender)"
# puthelp "PRIVMSG $ch :$ni $tv(tag)"
|
means : "Station, hour or day is wrong" followed by the station and the date |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Tue Sep 09, 2003 11:57 am Post subject: |
|
|
lol ok well i never took german seemed like a good bet tho heh. Remind me never to gamble  _________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
mark_OH Guest
|
Posted: Tue Sep 09, 2003 4:25 pm Post subject: |
|
|
ups sorry dudes i pasted an old version of the tv script, anyone can help me now with the real one?
| Code: |
#####################################################################
### ###
### TV-Programm v5.3 By Giggel (giggel@gmx.de) ###
### ###
#####################################################################
### Infos, Updates, Bugreports in der Scriptecke unter: ###
### http://irc.macht-bloe.de/script/ ###
### ###
### >>>>>>>>> NEU NEU NEU NEU NEU <<<<<<<<< ###
### ###
### Die Mailingliste zum Script mit aktuellen News und mehr ###
### und so meldet man sich an: ###
### mailto: majordomo@l611.hadiko.de ###
### Subject leer lassen ###
### Text: subscribe tv-script ###
### ###
#####################################################################
#
# This script is made for all the lazy guys who do NOT have a TV-Program.
# Its looking up the actual Program for the most _german_ TV-Stations
# at www.tvtoday.de and posts the answer (slightly cutted) to the channel,
# query or dcc-chat.
# I'm sure it has thousands of bugs, if you find one: TELL ME PLEAAAASE :)
# Also tell me, if you found a bug and fixed it.
#
############
# Examples:
# ---------
# !tv ard !tv ard 20
# ^^^ ^^
# Programm on ARD at 2000
#
# !tv ard 17 5
# ^
# print 5 lines instead of the defaultvalue set below
#
# !tv ard 20 5 1
# ^ ^
# show Program tomorrow and print 5 lines
#
########
# ToDo:
# -----
# - improving
# - bugfixing ;)
##############
### Syntax ###
##############
#
# -------public-------
# !tv Sender [Stunde] [Anzahl] [Tag]
#
# -------query--------
# /msg bot !tv Sender [Stunde] [Anzahl] [Tag]
# /msg bot tv Sender [Stunde] [Anzahl] [Tag]
#
# -------dcc-chat-----
# .tv Sender [Stunde] [Anzahl] [Tag]
#
# Anzahl is the number of lines,the bot pastes max. default is set below
#
# known Programs:
# haupt, ARD, ZDF, RTL, SAT.1, PRO 7, KABEL 1, RTL 2, S-RTL, ARTE, TM3,
# VOX, 3SAT, regio, NORD, WEST, BAYERN, MDR, HESSEN, SW III, TV BERLIN,
# MÜNCHEN, HH1, B1/SFB, ORB, MTV, VH1, VIVA, VIVA II, PREMIERE, DSF,
# E-SPORT, N-TV, E-NEWS, KINDER KANAL, PHOENIX, CNN, NBC, TNT, CARTOON,
# FRANC 2, FR3, TV5, TF1, ORF1, ORF2, TSR, DK1, DK2, DRS, NL1, NL2,
# NL3, TRT, SF1
#
# haupt is the group of: ARD, ZDF, RTL, SAT.1, PRO 7, KABEL 1, RTL 2,
# S-RTL, ARTE, TM3, VOX, 3SAT
# regio is the group of: NORD, WEST, BAYERN, MDR, HESSEN, SW III,
# TV BERLIN, MUENCHEN, HH1, B1/SFB, ORB
#
# Stunde is just a number from 00 to 29 where 24 means 00 of the next day
# 25 means 01 of next day and so on
# If no value is given the actual hour is taken
#
# Tag is: 0 = today, 1 = tomorrow ...
# default is 0
################
### Settings ###
################
#set channels that this script should work in
#script replies in every channel, if left blank
set tv(chans) ""
#max number of lines to put in channel
set maxpub 6
#number of lines to put to channel/query/dcc by default
set defpub 4
set defmsg 5
set defdcc 5
#how to answer to public query: NOTICE or MSG or PUB
set anspub "PUB"
#show special Program-Info, 0=off, 1=on
set showinfo 1
#how to display Program-Info if enabled: NOTICE or MSG or PUB
set ansnfo "NOTICE"
#userflag needed to use the script
#type "-" if the user don't need to have a botflag
set tv(flag) "-"
#Location of your lynx-Binary - try: which lynx
set tv(lynx) "/usr/bin/lynx"
#don't forget to add your entries for proxysettings in your local lynx.cfg file
#http_proxy environment variable may not work here!
#Location of a temporary outputfile
set tv(output) "/tmp/tv.txt"
########################################################
### You shouldn't change anything of the stuff below ###
########################################################
set tv(help) "Usage: \002PUB:\002 !tv Sender Stunde Tag/Anzahl Anzahl -\
\002DCC:\002 .tv Sender Stunde Tag/Anzahl Anzahl -\
\022MSG:\022 /msg $botnick !tv Sender Stunde Tag/Anzahl Anzahl"
set tv(sender) "Sender:\
haupt, ARD, ZDF, RTL, SAT1, PRO7, KABEL1, RTL2, S-RTL, ARTE, TM3,\
VOX, 3SAT, regio, NORD, WEST3, BAYERN3, MDR, HESSEN, SW3, TVBERLIN,\
MUENCHEN, HH1, B1/SFB, ORB, MTV, VH1, VIVA, VIVA2, PREMIERE, DSF,\
EUROSPORT, NTV, EURONEWS, KIKA, PHOENIX, CNN, NBC, TNT, CARTOON,\
FRANCE2, FR3, TV5, TF1, ORF1, ORF2, TSR, DK1, DK2, DRS, NL1, NL2, NL3,\
TRT, SF1"
set tv(tag) "Tag muss eine Zahl größer 0 sein, wobei 0 = heute ist"
set tv(anz) "Anzahl gibt an, wieviele Sendungen maximal ausgegeben werden"
set tv(server) www.tvtoday.de
set tv(script) /tv/programm/programm.php
set lines_out $defpub
set query ""
proc eval_sender {in} {
switch [string tolower $in] {
"haupt" { return "HS" }
"ard" { return "ARD" }
"zdf" { return "ZDF" }
"rtl" { return "RTL" }
"sat1" { return "SAT.1" }
"pro7" { return "PRO%207" }
"kabel1" { return "KABEL%201" }
"rtl2" { return "RTL%202" }
"s-rtl" { return "S-RTL" }
"arte" { return "ARTE" }
"tm3" { return "TM3" }
"vox" { return "VOX" }
"3sat" { return "3SAT" }
"regio" { return "RS" }
"n3" { return "NORD" }
"west3" { return "WEST" }
"bayern3" { return "BAYERN" }
"mdr" { return "MDR" }
"hessen" { return "HESSEN" }
"sw3" { return "SW%20III" }
"tvberlin" { return "TV%20BERLIN" }
"muenchen" { return "MÜNCHEN" }
"hh1" { return "HH1" }
"b1/sfb" { return "B1/SFB" }
"orb" { return "ORB" }
"mtv" { return "MTV" }
"vh1" { return "VH1" }
"viva" { return "VIVA" }
"viva2" { return "VIVA%20II" }
"premiere" { return "PREMIERE" }
"dsf" { return "DSF" }
"eurosport" { return "E-SPORT" }
"ntv" { return "N-TV" }
"euronews" { return "E-NEWS" }
"kika" { return "KINDERKANAL" }
"phoenix" { return "PHOENIX" }
"cnn" { return "CNN" }
"nbc" { return "NBC" }
"tnt" { return "TNT" }
"cartoon" { return "CARTOON" }
"france2" { return "FRANCE%202" }
"fr3" { return "FR3" }
"tv5" { return "TV5" }
"tf1" { return "TF1" }
"orf1" { return "ORF1" }
"orf2" { return "ORF2" }
"tsr" { return "TSR" }
"dk1" { return "DK1" }
"dk2" { return "DK2" }
"drs" { return "DRS" }
"nl1" { return "NL1" }
"nl2" { return "NL2" }
"nl3" { return "NL3" }
"trt" { return "TRT" }
"sf1" { return "SF1" }
}
return "NOPE1"
}
proc eval_stunde {in} {
set ok 0
if {[string length $in] == 1} {
set in "0$in"
}
if {[string first $in "00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23"] > -1} {
set ok 1
set tmp "Ax$in"
}
if {[string first $in "24 25 26 27 28 29"] > -1} {
set inn [expr $in-24]
set ok 1
set tmp "Bx0$inn"
}
if {$ok == 1} {
return $tmp
} else {
return "NOPE2"
}
}
proc eval_tag {in} {
set in [string toupper $in]
if {$in >= 0} {
return $in
} else {
return "NOPE3"
}
}
proc eval_daytoday {in} {
# by Haui
switch [string tolower $in] {
"mon" { return "MO" }
"tue" { return "DI" }
"wed" { return "MI" }
"thu" { return "DO" }
"fri" { return "FR" }
"sat" { return "SA" }
"sun" { return "SO" }
}
return "NOPE4"
}
proc eval_daybefore {in} {
# by Haui
switch [string tolower $in] {
"mon" { return "SO" }
"tue" { return "MO" }
"wed" { return "DI" }
"thu" { return "MI" }
"fri" { return "DO" }
"sat" { return "FR" }
"sun" { return "SA" }
}
return "NOPE5"
}
proc eval_rightday {in} {
# by Haui
set english_today [clock format [unixtime] -format %a]
set in "test[string tolower $in]"
if {[string first "bx" $in] >= 0} {
set right [eval_daybefore $english_today]
return $right
}
if {[string match "ax" $in] >= 0} {
set right [eval_daytoday $english_today]
return $right
}
}
proc makequery {how ni text} {
global lines_out tv
set right_day [eval_rightday [eval_stunde [clock format [unixtime] -format %H]]]
if {[llength $text] < 1} {
switch $how {
"dcc" {
putdcc $ni "$tv(help)"
putdcc $ni "$tv(sender)"
putdcc $ni "$tv(tag)"
putdcc $ni "$tv(anz)"
}
default {
puthelp "NOTICE ${ni} :$tv(help)"
puthelp "NOTICE ${ni} :$tv(sender)"
puthelp "NOTICE ${ni} :$tv(tag)"
puthelp "NOTICE ${ni} :$tv(anz)"
}
}
return 1
}
if {[llength $text] == 1} {
set query "?ztag=0&uhrzeit=[eval_stunde [clock format [unixtime] -format %H]]&sparte=alle&sender=[eval_sender $text]&action=suche"
}
if {[llength $text] == 2} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set query "?ztag=0&uhrzeit=[eval_stunde $std]&sparte=alle&sender=[eval_sender $sender]&action=suche"
}
if {[llength $text] == 3} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set lines_out [lindex $text 2]
## maximum Lines to paste into query = 20
if {($lines_out < 0) || ($lines_out > 20)} {
set lines_out 20
}
set query "?ztag=0&uhrzeit=[eval_stunde $std]&sparte=alle&sender=[eval_sender $sender]&action=suche"
}
if {[llength $text] > 3} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set lines_out [lindex $text 2]
set tag [lindex $text 3]
## maximum Lines to paste into query = 20
if {($lines_out < 0) || ($lines_out > 20)} {
set lines_out 20
}
if {$tag >= 0} {
set query "?ztag=$tag&uhrzeit=[eval_stunde $std]&sparte=alle&sender=[eval_sender $sender]&action=suche"
} else {
switch $how {
"dcc" {
putdcc $ni $tv(tag)
}
default {
puthelp "NOTICE ${ni} :$tv(tag)"
}
}
return 1
}
}
if {[string first "NOPE1" $query] > 0} {
switch $how {
"dcc" {
putdcc $ni "Diesen Sender kenne ich nicht. Bekannte Sender:"
putdcc $ni "$tv(sender)"
}
default {
puthelp "NOTICE ${ni} :Diesen Sender kenne ich nicht. Bekannte Sender:"
puthelp "NOTICE ${ni} :$tv(sender)"
}
}
return 1
}
if {[string first "NOPE2" $query] > 0} {
switch $how {
"dcc" {
putdcc $ni "Stunde falsch angegeben. Zweistellige Zahl von 00 bis 23"
}
default {
puthelp "NOTICE ${ni} :Stunde falsch angegeben. Zweistellige Zahl von 00 bis 23"
}
}
return 1
}
return $query
}
proc pub_tv {ni uh ha ch text} {
global tv lines_out defpub maxpub query showinfo ansnfo
if {$tv(chans) != ""} {
if {[string first $ch $tv(chans)] < 0} {
return 0
}
}
set lines_out $defpub
set query [makequery pub $ni $text]
if {$lines_out>$maxpub} {
set lines_out $maxpub
}
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f bla
set zeile [string trim $bla]
if {$raus == 1} {
if {[string first "\[" $zeile] == 0} {
incr x
if {$showinfo == 1} {
if {$ansnfo == "NOTICE"} {
puthelp "NOTICE ${ni} :$antwort"
}
if {$ansnfo == "PUB"} {
answer pub $ch $ni $antwort
}
if {$ansnfo == "MSG"} {
answer msg $ch $ni $antwort
}
}
set antwort ""
set maininfo 1
} else {
if {$maininfo == 1} {
answer pub $ch $ni $zeile
set maininfo 0
} else {
set antwort "$antwort$zeile "
}
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
}
close $f
}
proc msg_tv {ni uh ha text} {
global tv lines_out defmsg query showinfo
set lines_out $defmsg
set query [makequery msg $ni $text]
putlog "frage: http://$tv(server)$tv(script)$query"
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f bla
set zeile [string trim $bla]
if {$raus == 1} {
if {[string first "\[" $zeile] == 0} {
incr x
if {$showinfo == 1} {
answer msg $ha $ni $antwort
}
set antwort ""
set maininfo 1
} else {
if {$maininfo == 1} {
answer msg $ha $ni $zeile
set maininfo 0
} else {
set antwort "$antwort$zeile "
}
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
}
close $f
}
proc dcc_tv {ha idx text} {
global tv lines_out defdcc query showinfo
set lines_out $defdcc
set query [makequery dcc $idx $text]
putlog http://$tv(server)$tv(script)$query
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f bla
set zeile [string trim $bla]
if {$raus == 1} {
if {[string first "\[" $zeile] == 0} {
incr x
if {$showinfo == 1} {
answer dcc $ha $idx $antwort
}
set antwort ""
set maininfo 1
} else {
if {$maininfo == 1} {
answer dcc $ha $idx $zeile
set maininfo 0
} else {
set antwort "$antwort$zeile "
}
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
}
close $f
}
proc pub_tv_suche {ni uh ha ch text} {
global tv lines_out defpub maxpub query showinfo
if {$tv(chans) != ""} {
if {[string first $ch $tv(chans)] < 0} {
return 0
}
}
set lines_out $defpub
set query "?action=suche&suchbegriff=$text"
set query [join $query "+"]
if {$lines_out>$maxpub} {
set lines_out $maxpub
}
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f zeile
set bla [string trim $zeile]
if {$raus == 1} {
set zeile [string trim [string range $bla [expr [string first "\] " $bla]+1] [string length $bla]]]
if {[string first "\[" $zeile] == 0} {
incr x
answer pub $ch $ni $antwort
set antwort ""
set maininfo 1
} else {
set antwort "$antwort[string trim $zeile] "
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
if {[string first "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden." $zeile] > -1} {
set x $lines_out
answer pub $ch $ni "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden."
}
}
close $f
}
proc msg_tv_suche {ni uh ha text} {
global tv lines_out defmsg query showinfo
set lines_out $defmsg
set query "?action=suche&suchbegriff=$text"
set query [join $query "+"]
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f zeile
set bla [string trim $zeile]
if {$raus == 1} {
set zeile [string trim [string range $bla [expr [string first "\] " $bla]+1] [string length $bla]]]
if {[string first "\[" $zeile] == 0} {
incr x
answer msg $ha $ni $antwort
set antwort ""
set maininfo 1
} else {
set antwort "$antwort[string trim $zeile] "
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
if {[string first "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden." $zeile] > -1} {
set x $lines_out
answer msg $ha $ni "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden."
}
}
close $f
}
proc dcc_tv_suche {ha idx text} {
global tv lines_out defdcc showinfo
set lines_out $defdcc
set query "?action=suche&suchbegriff=$text"
set query [join $query "+"]
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f zeile
set bla [string trim $zeile]
if {$raus == 1} {
set zeile [string trim [string range $bla [expr [string first "\] " $bla]+1] [string length $bla]]]
if {[string first "\[" $zeile] == 0} {
incr x
answer dcc $ha $idx $antwort
set antwort ""
set maininfo 1
} else {
set antwort "$antwort[string trim $zeile] "
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
if {[string first "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden." $zeile] > -1} {
set x $lines_out
answer dcc $ha $idx "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden."
}
}
close $f
}
proc answer {how where who what} {
global anspub
switch $how {
"pub" {
switch [string toupper $anspub] {
"PUB" {
puthelp "PRIVMSG ${where} :$what"
}
"MSG" {
puthelp "PRIVMSG ${who} :$what"
}
default {
puthelp "NOTICE ${who} :$what"
}
}
}
"dcc" {
putdcc $who "$what"
}
"msg" {
puthelp "PRIVMSG ${who} :$what"
}
}
}
bind pub $tv(flag)|$tv(flag) !tv pub_tv
bind msg $tv(flag)|$tv(flag) !tv msg_tv
bind msg $tv(flag)|$tv(flag) tv msg_tv
bind dcc -|- tv dcc_tv
bind pub $tv(flag)|$tv(flag) !tvsuche pub_tv_suche
bind msg $tv(flag)|$tv(flag) !tvsuche msg_tv_suche
bind msg $tv(flag)|$tv(flag) tvsuche msg_tv_suche
bind dcc -|- tvsuche dcc_tv_suche
if {$tv(chans) == ""} {
putlog "TV-Program v5.3 by Giggel loaded for all channels .."
} else {
putlog "TV-Program v5.3 by Giggel loaded for $tv(chans) .."
}
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Sep 09, 2003 4:59 pm Post subject: |
|
|
why do you paste the whole script ?.. like the commented parts can be removes... the set arguments and binds can be removed just paste the procedure. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Tue Sep 09, 2003 6:11 pm Post subject: |
|
|
ok i pulled this url from the script and it worked on their website.
http://www.tvtoday.de/tv/programm/programm.php?action=suche&suchbegriff=ard
I got it from these parts in the script.
| Code: | set tv(server) www.tvtoday.de
set tv(script) /tv/programm/programm.php |
| Code: | proc dcc_tv_suche {ha idx text} {
global tv lines_out defdcc showinfo
set lines_out $defdcc
set query "?action=suche&suchbegriff=$text" |
So its not the website as i thought before.
Does it bring up any errors on the new script? _________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
GodOfSuicide Master

Joined: 17 Jun 2002 Posts: 463 Location: Austria
|
Posted: Wed Sep 10, 2003 1:45 am Post subject: |
|
|
i'd suggest taking a look into the TVScripts mailing list / hp
http://irc.macht-bloe.de/script/
the last fix was mentioned there 09.09.03 |
|
| Back to top |
|
 |
multikon Voice
Joined: 19 Jun 2004 Posts: 22
|
Posted: Mon Oct 04, 2004 8:19 pm Post subject: |
|
|
Hi
Have the new Version (09.09.04) but don't work
The error message, after few weeks, in the partyline is:
Tcl error [pub_tv]: couldn't duplicate input handle: bad file number
Main Code ...
| Code: | #####################################################################
### ###
### TV-Programm v5.7 By Giggel (giggel@gmx.de) ###
### ###
#####################################################################
### Infos, Updates, Bugreports in der Scriptecke unter: ###
### http://irc.mugiri.de/script/ ###
### ###
### >>>>>>>>> NEU NEU NEU NEU NEU <<<<<<<<< ###
### ###
### Die Mailingliste zum Script mit aktuellen News und mehr ###
### und so meldet man sich an: ###
### mailto: majordomo@brain.hadiko.de ###
### Subject leer lassen ###
### Text: subscribe tv-script ###
### ###
#####################################################################
#
# This script is made for all the lazy guys who do NOT have a TV-Program.
# Its looking up the actual Program for the most _german_ TV-Stations
# at www.tvtoday.de and posts the answer (slightly cutted) to the channel,
# query or dcc-chat.
# I'm sure it has thousands of bugs, if you find one: TELL ME PLEAAAASE :)
# Also tell me, if you found a bug and fixed it.
#
############
# Examples:
# ---------
# !tv ard !tv ard 20
# ^^^ ^^
# Programm on ARD at 2000
#
# !tv ard 17 5
# ^
# print 5 lines instead of the defaultvalue set below
#
# !tv ard 20 5 1
# ^ ^
# show Program tomorrow and print 5 lines
#
########
# ToDo:
# -----
# - improving
# - bugfixing ;)
##############
### Syntax ###
##############
#
# -------public-------
# !tv Sender [Stunde] [Anzahl] [Tag]
#
# -------query--------
# /msg bot !tv Sender [Stunde] [Anzahl] [Tag]
# /msg bot tv Sender [Stunde] [Anzahl] [Tag]
#
# -------dcc-chat-----
# .tv Sender [Stunde] [Anzahl] [Tag]
#
# Anzahl is the number of lines,the bot pastes max. default is set below
#
# known Programs:
# haupt, ARD, ZDF, RTL, SAT.1, PRO 7, KABEL 1, RTL 2, S-RTL, ARTE, TM3,
# VOX, 3SAT, regio, NDR, WEST, BAYERN, MDR, HESSEN, SW III, TV BERLIN,
# MÜNCHEN, HH1, B1/SFB, ORB, MTV, MTV2, VH1, VIVA, VIVA II, PREMIERE, DSF,
# E-SPORT, N-TV, E-NEWS, KINDER KANAL, PHOENIX, CNN, NBC, TNT, CARTOON,
# FRANC 2, FR3, TV5, TF1, ORF1, ORF2, TSR, DK1, DK2, DRS, NL1, NL2,
# NL3, TRT, SF1
#
# haupt is the group of: ARD, ZDF, RTL, SAT.1, PRO 7, KABEL 1, RTL 2,
# S-RTL, ARTE, TM3, VOX, 3SAT
# regio is the group of: NORD, WEST, BAYERN, MDR, HESSEN, SW III,
# TV BERLIN, MUENCHEN, HH1, B1/SFB, ORB
#
# Stunde is just a number from 00 to 29 where 24 means 00 of the next day
# 25 means 01 of next day and so on
# If no value is given the actual hour is taken
#
# Tag is: 0 = today, 1 = tomorrow ...
# default is 0
################
### Settings ###
################
#set channels that this script should work in
#script replies in every channel, if left blank
set tv(chans) ""
#max number of lines to put in channel
set maxpub 6
#number of lines to put to channel/query/dcc by default
set defpub 4
set defmsg 5
set defdcc 5
#how to answer to public query: NOTICE or MSG or PUB
set anspub "PUB"
#show special Program-Info, 0=off, 1=on
set showinfo 1
#how to display Program-Info if enabled: NOTICE or MSG or PUB
set ansnfo "NOTICE"
#userflag needed to use the script
#type "-" if the user don't need to have a botflag
set tv(flag) ""
#Location of your lynx-Binary - try: which lynx
# BSD
set tv(lynx) "c:/windrop-1.6/lynx.exe"
# Linux (z.B. SuSE)
#set tv(lynx) "/windrop-1.6/"
#don't forget to add your entries for proxysettings in your local lynx.cfg file
#http_proxy environment variable may not work here!
#Location of a temporary outputfile
set tv(output) "/tv.txt"
########################################################
### You shouldn't change anything of the stuff below ###
########################################################
set tv(help) "Usage: \002PUB:\002 !tv Sender Stunde Tag/Anzahl Anzahl -\
\002DCC:\002 .tv Sender Stunde Tag/Anzahl Anzahl -\
\022MSG:\022 /msg $botnick !tv Sender Stunde Tag/Anzahl Anzahl"
set tv(sender) "Sender:\
haupt, ARD, ZDF, RTL, SAT1, PRO7, KABEL1, RTL2, S-RTL, ARTE, TM3,\
VOX, 3SAT, regio, NORD, WEST3, BAYERN3, MDR, HESSEN, SW3, TVBERLIN,\
MUENCHEN, HH1, B1/SFB, ORB, MTV, MTV2, VH1, VIVA, VIVA2, PREMIERE, DSF,\
EUROSPORT, NTV, EURONEWS, KIKA, PHOENIX, CNN, NBC, TNT, CARTOON,\
FRANCE2, FR3, TV5, TF1, ORF1, ORF2, TSR, DK1, DK2, DRS, NL1, NL2, NL3,\
TRT, SF1"
set tv(tag) "Tag muss eine Zahl größer 0 sein, wobei 0 = heute ist"
set tv(anz) "Anzahl gibt an, wieviele Sendungen maximal ausgegeben werden"
set tv(server) www.tvtoday.de
set tv(script) /tv/programm/programm.php
set lines_out $defpub
set query ""
proc eval_sender {in} {
switch [string tolower $in] {
"haupt" { return "HS" }
"ard" { return "ARD" }
"zdf" { return "ZDF" }
"rtl" { return "RTL" }
"sat1" { return "SAT.1" }
"pro7" { return "PRO%207" }
"kabel1" { return "KABEL%201" }
"rtl2" { return "RTL%202" }
"s-rtl" { return "S-RTL" }
"arte" { return "ARTE" }
"tm3" { return "TM3" }
"vox" { return "VOX" }
"3sat" { return "3SAT" }
"regio" { return "RS" }
"ndr" { return "NDR" }
"west3" { return "WEST" }
"bayern3" { return "BAYERN" }
"mdr" { return "MDR" }
"hessen" { return "HESSEN" }
"sw3" { return "SW%20III" }
"tvberlin" { return "TV%20BERLIN" }
"muenchen" { return "MÜNCHEN" }
"hh1" { return "HH1" }
"b1/sfb" { return "B1/SFB" }
"orb" { return "ORB" }
"mtv" { return "MTV" }
"mtv2" { return "MTV2" }
"vh1" { return "VH1" }
"viva" { return "VIVA" }
"viva2" { return "VIVA%20II" }
"premiere" { return "PREMIERE" }
"dsf" { return "DSF" }
"eurosport" { return "E-SPORT" }
"ntv" { return "N-TV" }
"euronews" { return "E-NEWS" }
"kika" { return "KINDERKANAL" }
"phoenix" { return "PHOENIX" }
"cnn" { return "CNN" }
"nbc" { return "NBC" }
"tnt" { return "TNT" }
"cartoon" { return "CARTOON" }
"france2" { return "FRANCE%202" }
"fr3" { return "FR3" }
"tv5" { return "TV5" }
"tf1" { return "TF1" }
"orf1" { return "ORF+1" }
"orf2" { return "ORF+2" }
"tsr" { return "TSR" }
"dk1" { return "DK1" }
"dk2" { return "DK2" }
"drs" { return "DRS" }
"nl1" { return "NL1" }
"nl2" { return "NL2" }
"nl3" { return "NL3" }
"trt" { return "TRT" }
"sf1" { return "SF1" }
}
return "NOPE1"
}
proc eval_stunde {in} {
set ok 0
if {[string length $in] == 1} {
set in "0$in"
}
if {[string first $in "00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23"] > -1} {
set ok 1
set tmp "$in"
}
if {[string first $in "24 25 26 27 28 29"] > -1} {
set inn [expr $in-24]
set ok 1
set tmp "0$inn"
}
if {$ok == 1} {
return $tmp
} else {
return "NOPE2"
}
}
proc eval_tag {in} {
set in [string toupper $in]
if {$in >= 0} {
return $in
} else {
return "NOPE3"
}
}
proc eval_daytoday {in} {
# by Haui
switch [string tolower $in] {
"mon" { return "MO" }
"tue" { return "DI" }
"wed" { return "MI" }
"thu" { return "DO" }
"fri" { return "FR" }
"sat" { return "SA" }
"sun" { return "SO" }
}
return "NOPE4"
}
proc eval_daybefore {in} {
# by Haui
switch [string tolower $in] {
"mon" { return "SO" }
"tue" { return "MO" }
"wed" { return "DI" }
"thu" { return "MI" }
"fri" { return "DO" }
"sat" { return "FR" }
"sun" { return "SA" }
}
return "NOPE5"
}
proc eval_rightday {in} {
# by Haui
set english_today [clock format [unixtime] -format %a]
set in "test[string tolower $in]"
if {[string first "bx" $in] >= 0} {
set right [eval_daybefore $english_today]
return $right
}
if {[string match "ax" $in] >= 0} {
set right [eval_daytoday $english_today]
return $right
}
}
proc makequery {how ni text} {
global lines_out tv
set right_day [eval_rightday [eval_stunde [clock format [unixtime] -format %H]]]
if {[llength $text] < 1} {
switch $how {
"dcc" {
putdcc $ni "$tv(help)"
putdcc $ni "$tv(sender)"
putdcc $ni "$tv(tag)"
putdcc $ni "$tv(anz)"
}
default {
puthelp "NOTICE ${ni} :$tv(help)"
puthelp "NOTICE ${ni} :$tv(sender)"
puthelp "NOTICE ${ni} :$tv(tag)"
puthelp "NOTICE ${ni} :$tv(anz)"
}
}
return 1
}
if {[llength $text] == 1} {
set query "?ztag=0&uhrzeit=[eval_stunde [clock format [unixtime] -format %H]]&sparte=alle&sender=[eval_sender $text]&action=suche"
}
if {[llength $text] == 2} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set query "?ztag=0&uhrzeit=[eval_stunde $std]&sparte=alle&sender=[eval_sender $sender]&action=suche"
}
if {[llength $text] == 3} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set lines_out [lindex $text 2]
## maximum Lines to paste into query = 20
if {($lines_out < 0) || ($lines_out > 20)} {
set lines_out 20
}
set query "?ztag=0&uhrzeit=[eval_stunde $std]&sparte=alle&sender=[eval_sender $sender]&action=suche"
}
if {[llength $text] > 3} {
set sender [string tolower [lindex $text 0]]
set std [lindex $text 1]
set lines_out [lindex $text 2]
set tag [lindex $text 3]
## maximum Lines to paste into query = 20
if {($lines_out < 0) || ($lines_out > 20)} {
set lines_out 20
}
if {$tag >= 0} {
set query "?ztag=$tag&uhrzeit=[eval_stunde $std]&sparte=alle&sender=[eval_sender $sender]&action=suche"
} else {
switch $how {
"dcc" {
putdcc $ni $tv(tag)
}
default {
puthelp "NOTICE ${ni} :$tv(tag)"
}
}
return 1
}
}
if {[string first "NOPE1" $query] > 0} {
switch $how {
"dcc" {
putdcc $ni "Diesen Sender kenne ich nicht. Bekannte Sender:"
putdcc $ni "$tv(sender)"
}
default {
puthelp "NOTICE ${ni} :Diesen Sender kenne ich nicht. Bekannte Sender:"
puthelp "NOTICE ${ni} :$tv(sender)"
}
}
return 1
}
if {[string first "NOPE2" $query] > 0} {
switch $how {
"dcc" {
putdcc $ni "Stunde falsch angegeben. Zweistellige Zahl von 00 bis 23"
}
default {
puthelp "NOTICE ${ni} :Stunde falsch angegeben. Zweistellige Zahl von 00 bis 23"
}
}
return 1
}
return $query
}
proc pub_tv {ni uh ha ch text} {
global tv lines_out defpub maxpub query showinfo ansnfo
if {$tv(chans) != ""} {
if {[string first [string tolower $ch] [string tolower $tv(chans)]] < 0} {
return 0
}
}
set lines_out $defpub
set query [makequery pub $ni $text]
if {$lines_out>$maxpub} {
set lines_out $maxpub
}
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f bla
set zeile [string trim $bla]
if {$raus == 1} {
if {[string first "\[" $zeile] == 0} {
incr x
if {$showinfo == 1} {
if {$ansnfo == "NOTICE"} {
puthelp "NOTICE ${ni} :$antwort"
}
if {$ansnfo == "PUB"} {
answer pub $ch $ni $antwort
}
if {$ansnfo == "MSG"} {
answer msg $ch $ni $antwort
}
}
set antwort ""
set maininfo 1
} else {
if {$maininfo == 1} {
set cutit [string first "." $zeile]
incr cutit -2
set zeile [string range $zeile $cutit [string length $zeile]]
answer pub $ch $ni $zeile
set maininfo 0
} else {
set antwort "$antwort$zeile "
}
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
}
close $f
}
proc msg_tv {ni uh ha text} {
global tv lines_out defmsg query showinfo
set lines_out $defmsg
set query [makequery msg $ni $text]
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f bla
set zeile [string trim $bla]
if {$raus == 1} {
if {[string first "\[" $zeile] == 0} {
incr x
if {$showinfo == 1} {
answer msg $ha $ni $antwort
}
set antwort ""
set maininfo 1
} else {
if {$maininfo == 1} {
set cutit [string first "." $zeile]
incr cutit -2
set zeile [string range $zeile $cutit [string length $zeile]]
answer msg $ha $ni $zeile
set maininfo 0
} else {
set antwort "$antwort$zeile "
}
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
}
close $f
}
proc dcc_tv {ha idx text} {
global tv lines_out defdcc query showinfo
set lines_out $defdcc
set query [makequery dcc $idx $text]
putlog http://$tv(server)$tv(script)$query
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f bla
set zeile [string trim $bla]
if {$raus == 1} {
if {[string first "\[" $zeile] == 0} {
incr x
if {$showinfo == 1} {
answer dcc $ha $idx $antwort
}
set antwort ""
set maininfo 1
} else {
if {$maininfo == 1} {
set cutit [string first "." $zeile]
incr cutit -2
set zeile [string range $zeile $cutit [string length $zeile]]
answer dcc $ha $idx $zeile
set maininfo 0
} else {
set antwort "$antwort$zeile "
}
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
}
close $f
}
proc pub_tv_suche {ni uh ha ch text} {
global tv lines_out defpub maxpub query showinfo
if {$tv(chans) != ""} {
if {[string first [string tolower $ch] [string tolower $tv(chans)]] < 0} {
return 0
}
}
set lines_out $defpub
set query "?action=suche&suchbegriff=$text"
set query [join $query "+"]
if {$lines_out>$maxpub} {
set lines_out $maxpub
}
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f zeile
set bla [string trim $zeile]
if {$raus == 1} {
set zeile [string trim [string range $bla [expr [string first "\] " $bla]+1] [string length $bla]]]
if {[string first "\[" $zeile] == 0} {
incr x
set cutit [string first "." $zeile]
incr cutit -2
set antwort [string range $antwort $cutit [string length $antwort]]
answer pub $ch $ni $antwort
set antwort ""
set maininfo 1
} else {
set antwort "$antwort[string trim $zeile] "
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
if {[string first "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden." $zeile] > -1} {
set x $lines_out
answer pub $ch $ni "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden."
}
if {[string first "\[pfeil_oben.gif\]" $zeile] > -1} {
set x $lines_out
}
}
close $f
}
proc msg_tv_suche {ni uh ha text} {
global tv lines_out defmsg query showinfo
set lines_out $defmsg
set query "?action=suche&suchbegriff=$text"
set query [join $query "+"]
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f zeile
set bla [string trim $zeile]
if {$raus == 1} {
set zeile [string trim [string range $bla [expr [string first "\] " $bla]+1] [string length $bla]]]
if {[string first "\[" $zeile] == 0} {
incr x
set cutit [string first "." $zeile]
incr cutit -2
set antwort [string range $antwort $cutit [string length $antwort]]
answer msg $ha $ni $antwort
set antwort ""
set maininfo 1
} else {
set antwort "$antwort[string trim $zeile] "
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
if {[string first "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden." $zeile] > -1} {
set x $lines_out
answer msg $ha $ni "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden."
}
if {[string first "\[pfeil_oben.gif\]" $zeile] > -1} {
set x $lines_out
}
}
close $f
}
proc dcc_tv_suche {ha idx text} {
global tv lines_out defdcc showinfo
set lines_out $defdcc
set query "?action=suche&suchbegriff=$text"
set query [join $query "+"]
exec >$tv(output) $tv(lynx) -dump -nolist "http://$tv(server)$tv(script)$query"
putlog "http://$tv(server)$tv(script)$query"
set f [open $tv(output) r]
set x 0
set raus 0
set antwort ""
set maininfo 1
while {(![eof $f]) && ($x<$lines_out)} {
gets $f zeile
set bla [string trim $zeile]
if {$raus == 1} {
set zeile [string trim [string range $bla [expr [string first "\] " $bla]+1] [string length $bla]]]
if {[string first "\[" $zeile] == 0} {
incr x
set cutit [string first "." $zeile]
incr cutit -2
set antwort [string range $antwort $cutit [string length $antwort]]
answer dcc $ha $idx $antwort
set antwort ""
set maininfo 1
} else {
set antwort "$antwort[string trim $zeile] "
}
}
if {[string first "P R O G R A M M" $zeile] > -1} {
gets $f zeile
set raus 1
}
if {[string first "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden." $zeile] > -1} {
set x $lines_out
answer dcc $ha $idx "Leider konnte keine Sendung mit Ihrem Suchbegriff gefunden werden."
}
if {[string first "\[pfeil_oben.gif\]" $zeile] > -1} {
set x $lines_out
}
}
close $f
}
proc answer {how where who what} {
global anspub
switch $how {
"pub" {
switch [string toupper $anspub] {
"PUB" {
puthelp "PRIVMSG ${where} :$what"
}
"MSG" {
puthelp "PRIVMSG ${who} :$what"
}
default {
puthelp "NOTICE ${who} :$what"
}
}
}
"dcc" {
putdcc $who "$what"
}
"msg" {
puthelp "PRIVMSG ${who} :$what"
}
}
}
bind pub $tv(flag)|$tv(flag) !tv pub_tv
bind msg $tv(flag)|$tv(flag) !tv msg_tv
bind msg $tv(flag)|$tv(flag) tv msg_tv
bind dcc -|- tv dcc_tv
bind pub $tv(flag)|$tv(flag) !tvsuche pub_tv_suche
bind msg $tv(flag)|$tv(flag) !tvsuche msg_tv_suche
bind msg $tv(flag)|$tv(flag) tvsuche msg_tv_suche
bind dcc -|- tvsuche dcc_tv_suche
if {$tv(chans) == ""} {
putlog "TV-Program v5.7 by Giggel loaded for all channels .."
} else {
putlog "TV-Program v5.7 by Giggel loaded for $tv(chans) .."
}
|
|
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Mon Oct 04, 2004 9:38 pm Post subject: |
|
|
Suggestion:
mailto: majordomo@brain.hadiko.de, giggel@gmx.de _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|