package require http # remember this url: http://www.geeklog.net/staticpages/index.php?page=20030206094434245 package require tls ::http::register https 443 ::tls::socket namespace eval ::RDF { set Leaf "NewsFlash db_bot " set forceload 1 set cleanload 0 if {![info exists Sites] || $cleanload || $forceload} { if {![info exists Sites] || $cleanload} {set Sites [list]} #lappend Sites "name url" #lappend Sites "" # # # https://www.golem.de/sonstiges/rss.html # https://rss.golem.de/rss.php?feed=RSS0.91 # http://feeds.4players.de/Allgemein/news/-/rss.xml # https://www.gamersglobal.de/news/feed # lappend Sites "4Players http://feeds.4players.de/Allgemein/news/-/rss.xml" lappend Sites "GamersGlobal https://www.gamersglobal.de/news/feed" lappend Sites "derQuaker http://www.derquaker.com/?feed=rss" lappend Sites "tip http://www.tip-berlin.de/start/news.xml" lappend Sites "Morgenpost http://www.morgenpost.de/?service=Rss" lappend Sites "Morgenpost-Berlin http://www.morgenpost.de/berlin/?service=Rss" #lappend Sites "Morgenpost-Sport http://www.morgenpost.de/sport/berlin-sport/?service=Rss" #lappend Sites "Morgenpost-Kultur http://www.morgenpost.de/kultur/berlin-kultur/?service=Rss" lappend Sites "Morgenpost-Bezirke http://www.morgenpost.de/bezirke/?service=Rss" lappend Sites "Morgenpost-Navigator http://www.morgenpost.de/berlin/navigator/?service=Rss" lappend Sites "Morgenpost-Shopping http://www.morgenpost.de/berlin/shopping/?service=Rss" lappend Sites "Morgenpost-Verkehr http://www.morgenpost.de/berlin/verkehrsmelder/?service=Rss" lappend Sites "Morgenpost-Bestof http://www.morgenpost.de/berlin/best-of-berlin/?service=Rss" lappend Sites "Morgenpost-Horrmann http://www.morgenpost.de/kolumne/horrmann/?service=Rss" lappend Sites "LFS-News http://www.lfsworld.net/feeds.php?type=news&f=0" lappend Sites "SPOX.com http://www.spox.com/pub/rss/sport.xml" lappend Sites "Formula1-Headlines http://www.formula1.com/rss/news/headlines.rss" lappend Sites "Formula1-Features http://www.formula1.com/rss/news/features.rss" lappend Sites "Hauptstadtblog http://feeds.feedburner.com/Hauptstadtblog" lappend Sites "Berlin-Journal http://blog.zeit.de/berlinjournal/?feed=atom" lappend Sites "KQE http://kqe.de/feed_rss" lappend Sites "Titanic http://www.titanic-magazin.de/ich.war.bei.der.waffen.rss" lappend Sites "MGG http://feeds.feedburner.com/MilitaryGraphicsCollection-de?format=xml" lappend Sites "ZDFheute http://www.heute.de/ZDFheute/inhalt/rss/20/0,6704,20,00.xml" lappend Sites "GulliNews http://ticker.gulli.com/rss" # MST-xxx geht auch lappend Sites "Motorsport-Total-Formel1 http://www.motorsport-total.com/rss_f1.xml" lappend Sites "Motorsport-Total-DTM http://www.motorsport-total.com/rss_dtm.xml" lappend Sites "Motorsport-Total-Rallye http://www.motorsport-total.com/rss_rallye.xml" lappend Sites "Motorsport-Total-Motorrad http://www.motorsport-total.com/rss_motorrad.xml" lappend Sites "Motorsport-Total-Formelsport http://www.motorsport-total.com/rss_formelsport.xml" lappend Sites "Motorsport-Total-US-Racing http://www.motorsport-total.com/rss_usracing.xml" lappend Sites "Motorsport-Total-Sportwagen http://www.motorsport-total.com/rss_auto.xml" lappend Sites "Motorsport-Total-Games http://www.motorsport-total.com/rss_games.xml" lappend Sites "Motorsport-Total-Mehr http://www.motorsport-total.com/rss_mehrmotorsport.xml" # MSM-xxx geht auch lappend Sites "Motorsport-Magazin-Alle-Rennserien http://www.motorsport-magazin.com/rss/alle-rennserien.xml" lappend Sites "Motorsport-Magazin-Formel1 http://www.motorsport-magazin.com/rss/formel1.xml" # lappend Sites "Motorsport-Magazin-Motorrad http://www.motorsport-magazin.com/rss/motorrad.xml" lappend Sites "Motorsport-Magazin-Sportwagen http://www.motorsport-magazin.com/rss/sportwagen.xml" lappend Sites "Motorsport-Magazin-DTM http://www.motorsport-magazin.com/rss/dtm.xml" lappend Sites "Motorsport-Magazin-Rallye http://www.motorsport-magazin.com/rss/rallye.xml" lappend Sites "Motorsport-Magazin-Mehr-Motorsport http://www.motorsport-magazin.com/rss/motorsport.xml" lappend Sites "Motorsport-Magazin-ADAC-Motorsport http://www.motorsport-magazin.com/rss/adac-motorsport.xml" lappend Sites "Motorsport-Magazin-24h-Nürburg http://www.motorsport-magazin.com/rss/24h-stunden-nuerburgring.xml" lappend Sites "Motorsport-Magazin-24h-LeMans http://www.motorsport-magazin.com/rss/24h-stunden-le-mans.xml" lappend Sites "Motorsport-Magazin-ADAC-Bahnsport http://www.motorsport-magazin.com/rss/adac-bahnsport.xml" lappend Sites "Motorsport-Magazin-ADAC-Enduro http://www.motorsport-magazin.com/rss/adac-enduro-rallye-cup.xml" lappend Sites "Motorsport-Magazin-ADAC-Formel-Masters http://www.motorsport-magazin.com/rss/adac-formel-masters.xml" lappend Sites "Motorsport-Magazin-ADAC-GT-Masters http://www.motorsport-magazin.com/rss/adac-gt-masters.xml" #lappend Sites "Motorsport-Magazin-ADAC-Jetboot http://www.motorsport-magazin.com/rss/adac-jetboot-cup.xml" lappend Sites "Motorsport-Magazin-ADAC-Junior http://www.motorsport-magazin.com/rss/adac-junior-cup.xml" lappend Sites "Motorsport-Magazin-ADAC-Kart-Masters http://www.motorsport-magazin.com/rss/adac-kart-masters.xml" lappend Sites "Motorsport-Magazin-ADAC-Kartslalom http://www.motorsport-magazin.com/rss/adac-kartslalom-cup.xml" #lappend Sites "Motorsport-Magazin- " #lappend Sites "Motorsport-Magazin- " # lappend Sites "Motorsport-Magazin-Games http://www.motorsport-magazin.com/rss/games.xml" lappend Sites "Motorsport-Magazin-eSports http://www.motorsport-magazin.com/rss/esports.xml" #lappend Sites "Motorsport-Magazin- " #lappend Sites "Motorsport-Magazin- " #lappend Sites "Motorsport-Magazin- " #lappend Sites "Motorsport-Magazin- " # lappend Sites "AutoMotorSport http://rss.feedsportal.com/c/685/f/434712/index.rss" lappend Sites "Speedmaniacs http://www.speedmaniacs.com/feed/news.xml" #lappend Sites "Speedmaniacs http://rss.feedsportal.com/feed/speedmaniacs/news" lappend Sites "onlinekosten http://www.onlinekosten.de/news/ticker.php?format=rdf" lappend Sites "Formel1 http://www.formel1.de/f1_tools/rss/newsticker.xml" lappend Sites "BerlinOnline http://www.berlinonline.de/aktuelles/berlin/_inc/index.rdf" lappend Sites "BerlinOnline-Polizei http://www.berlin.de/polizei/polizeimeldungen/index.php/rss" lappend Sites "B-Nachrichten http://www.berlinonline.de/aktuelles/nachrichten/_inc/index.rdf" lappend Sites "ComputerBase http://www.computerbase.de/rss/news.xml" lappend Sites "Quake.de http://www.quake.de/rss.php" lappend Sites "PC-Games http://www.pcgames.de/feed.cfm?menu_alias=home" lappend Sites "N24 http://www.n24.de/2/nachrichten/index.rss" lappend Sites "heise.de http://www.heise.de/newsticker/heise.rdf" lappend Sites "spiegel.de http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml" lappend Sites "Golem-Hardware http://www.golem.de/backends/golemrdf_10_hw.rdf" lappend Sites "Tagesschau http://www.tagesschau.de/xml/rss2" lappend Sites "DP-Headline http://www.dailyprincetonian.com/feeds/section/news/" lappend Sites "Golem-Software http://www.golem.de/backends/golemrdf_10_sw.rdf" lappend Sites "WP-World http://xml.newsisfree.com/feeds/88/2088.xml" lappend Sites "CNN-World http://rss.cnn.com/rss/cnn_world.rss" lappend Sites "Telepolis http://www.heise.de/tp/news.rdf" lappend Sites "CNN-Head http://rss.cnn.com/rss/cnn_topstories.rss" lappend Sites "Newsweek http://xml.newsisfree.com/feeds/11/3411.xml" lappend Sites "WP-Front http://xml.newsisfree.com/feeds/87/2087.xml" lappend Sites "mozilla.org http://www.mozilla.org/news.rdf" lappend Sites "Golem-Networld http://www.golem.de/backends/golemrdf_10_nw.rdf" lappend Sites "ComputerBase http://www.computerbase.de/rss/news.xml" lappend Sites "PC-Games http://www.pcgames.de/feed.cfm?menu_alias=home" lappend Sites "winfuture http://www.winfuture.de/winfuturenews.xml" lappend Sites "NY-Times-National http://www.nytimes.com/services/xml/rss/nyt/National.xml" lappend Sites "Golem-Telekomm http://www.golem.de/backends/golemrdf_10_tk.rdf" lappend Sites "spiegel.de http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml" lappend Sites "USA-Today http://rssfeeds.usatoday.com/usatoday-NewsTopStories" lappend Sites "CNN-Euro http://rss.cnn.com/rss/edition_europe.rss" lappend Sites "BBC-World http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml" lappend Sites "NY-Times-International http://www.nytimes.com/services/xml/rss/nyt/International.xml" lappend Sites "Golem-Enter http://www.golem.de/backends/golemrdf_10_et.rdf" lappend Sites "symlink.ch http://www.symlink.ch/symlinkch.rdf" lappend Sites "Golem-Wirtschaft http://www.golem.de/backends/golemrdf_10_wi.rdf" lappend Sites "heise-security http://www.heise.de/security/news/news.rdf" lappend Sites "ComputerBase http://www.computerbase.de/rss/news.xml" lappend Sites "PC-Games http://www.pcgames.de/feed.cfm?menu_alias=home" lappend Sites "spiegel.de http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml" lappend Sites "Golem-Hardware http://www.golem.de/backends/golemrdf_10_hw.rdf" lappend Sites "Golem-Software http://www.golem.de/backends/golemrdf_10_sw.rdf" lappend Sites "heise.de http://www.heise.de/newsticker/heise.rdf" lappend Sites "ComputerBase http://www.computerbase.de/rss/news.xml" lappend Sites "Golem-Networld http://www.golem.de/backends/golemrdf_10_nw.rdf" lappend Sites "Rus-Cert http://CERT.Uni-Stuttgart.DE/ticker/rus-cert.rdf" lappend Sites "Golem-Telekomm http://www.golem.de/backends/golemrdf_10_tk.rdf" lappend Sited "Scienceticker http://www.scienceticker.info/rss/RSS_File.xml" lappend Sites "spiegel.de http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml" lappend Sites "PC-Games http://www.pcgames.de/feed.cfm?menu_alias=home" lappend Sites "greenpeace.org http://archive.greenpeace.org/rss/gpeng.rdf" lappend Sites "ComputerBase http://www.computerbase.de/rss/news.xml" lappend Sites "spiegel.de http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml" lappend Sites "Rus-Cert-elsewhere http://CERT.Uni-Stuttgart.DE/ticker/rus-cert-elsewhere.rdf" lappend Sites "Gamestar http://www.gamestar.de/news/rss/news.rss" lappend Sites "PC-Games http://www.pcgames.de/feed.cfm?menu_alias=home" lappend Sites "Newsweek http://xml.newsisfree.com/feeds/11/3411.xml" lappend Sites "WP-Front http://xml.newsisfree.com/feeds/87/2087.xml" lappend Sites "Golem-Enter http://www.golem.de/backends/golemrdf_10_et.rdf" lappend Sites "Golem-Wirtschaft http://www.golem.de/backends/golemrdf_10_wi.rdf" lappend Sites "SuSE-Security http://www.suse.de/de/security/channel/suse_security.rdf" lappend Sites "debian.org http://www.debian.org/security/dsa.de.rdf" lappend Sites "LFM-CyBex http://ws.audioscrobbler.com/1.0/user/CyBexBerlin/recenttracks.rss" } proc returnrandom {args} {return [rand 2]} proc randomizelist list { set list [lsort -command ::RDF::returnrandom [lsort -uni $list]] return $list # set l [llength $list] for {set i 0} {$i<=$l} {incr i} { set x [lindex $list [set p [rand $l]]] set list [lreplace $list $p $p] set list [linsert $list [rand $l] $x] } return $list } set Sites [randomizelist $Sites] set Last(Init) 1; set LastDesc(Init) 1; set UsePrivmsg 1 set UseLeaf 1 set Chans "#cybex.test " # --- compat --- for tclsh -- if [info exist ::version] { set eggdrop 1 } { set eggdrop 0 } proc myputlog { args } { if $RDF::eggdrop { putlog $args } { puts $args } } proc myputcmdlog { args } { if $RDF::eggdrop { putcmdlog $args } { puts $args } } # --- load/save --- proc loadfile {name args} { if {[info exists name] && [file exists $name]} { set fh [open $name r] set gets [read $fh]; # set gets [gets $fh] close $fh return $gets } { return "" } } proc savefile {name data} { set fh [open "${name}.tmp" w] puts $fh $data close $fh file rename -force "${name}.tmp" $name savesites } proc savesites {args} { set fh [open "LastSites.tcl" w] puts $fh "set ::RDF::Sites \[list]" foreach Site $::RDF::Sites { puts $fh "lappend ::RDF::Sites \"$Site\"" } close $fh } # --- proc --- proc outnews {} { set out [lindex $::OutQueue 0] set ::OutQueue [lrange $::OutQueue 1 end] switch [lindex $out 0] { msg {putmsg [lindex $out 1] [lindex $out 2]} topic {puthelp "TOPIC [lindex $out 1] :[lindex $out 2]"} } #putcmdlog "Out: 0:'[lindex $out 0]' 1:'[lindex $out 1]' 2:'[lindex $out 2]'; [llength $::OutQueue]" if {[llength $::OutQueue]>0} { utimer 3 [namespace current]::outnews } } proc putnewstopic {dest text} { lappend ::OutQueue [list topic $dest $text] #putcmdlog "putnews utimerexists [namespace current]::outnews==[utimerexists [namespace current]::outnews]; " if {[utimerexists [namespace current]::outnews]==""} {utimer 2 [namespace current]::outnews} } proc putnews {dest text} { lappend ::OutQueue [list msg $dest $text] #putcmdlog "putnews utimerexists [namespace current]::outnews==[utimerexists [namespace current]::outnews]; " if {[utimerexists [namespace current]::outnews]==""} {utimer 2 [namespace current]::outnews} } proc returnrandom {args} {return [rand 2]} proc randomizelist list { set list [lsort -command ::RDF::returnrandom [lsort -uni $list]] return $list # set l [llength $list] for {set i 0} {$i<=$l} {incr i} { set x [lindex $list [set p [rand $l]]] set list [lreplace $list $p $p] set list [linsert $list [rand $l] $x] } return $list } proc Randomize args { set RDF::Sites [randomizelist [lsort -uni $RDF::Sites]] } proc SendBot { args } { #myputcmdlog "RDF-SB: Send $args to Bots" if {$::botnick=="NewS-FlasH"} { postrdf $::botnick "RDF:" [join $args] } foreach bot [bots] { if {([lsearch -exact [string tolower $RDF::Leaf] [string tolower $bot]] != -1)} { putbot $bot "RDF: [join $args]" } } } proc html2text {html} { regsub -all -- {(\\|\[|\])} $html {\\\1} text regsub -all -- "�{0,2}(\\d+);" $text {[format %c \1]} text set text [subst -novariables $text] set text [string map [list [format %c 8220] "'" [format %c 8222] "'"] $text] foreach {d t} [regexp -all -inline {&#(.+?);} $text] {set text [string map -nocase [list $d [format %c [expr 0$t]]] $text]} return [string map [list {¿} {¿} {ä} {ä} {Ä} {Ä} {ö} ö {Ö} {Ö} {ü} ü {Ü} {Ü} {ß} {ß} \ {} {} {} {} {'} \' {"} \" {„} \" {‘} \' {–} {-} {é} {é} \ {&eagrave;} {è} {ï} {ï} {&} {&} { } { } {>} {>} {<} {<} {♦} {*} {€} {€} \ {©} {©} {™} {™} {¡} {¡} {¢} {¢} {£} {£} {§} {§} {¨} \" \ {±} {±} {²} {²} {³} {³} {´} \' {µ} {µ} {¶} {¶} {·} {·} \ {¼} {¼} {½} {½} {¾} {¾} {•} {·} ] $text] } proc GetRDF { args } { set query [lindex $args 0]; set site [lindex $args 1] putcmdlog "\002[namespace current]::GetRDF\002 \037$site\037 $query;" #set cyagent "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)"; set cyagent "CyNews/${RDF::Ver} (compatible; Linux)"; #set cyagent "Mozilla/4.0" #set cyagent "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)"; #set query [string map [list "https://" "http://"] $query] set token [http::config -useragent $cyagent]; catch { set token [http::geturl $query -timeout 15000] } error; if {$error!=$token} { putcmdlog "GetRDF error:$error;"; return "-1 Error 404 not found"; } puts stderr ""; upvar #0 $token state; set size [array size state]; set getstate [array get state]; array unset ::laststate; array set ::laststate [array get state] putcmdlog "GetRDF: site:$site; state(http):$state(http);" ; # "state:[array get state];" if {[string tolower [lindex $state(http) 2]] != "ok"} { set st $state(http) catch {set htmldata [http::data $token]} catch {putcmdlog "GetRDF state: hdata:([string length $htmldata]); state:$st;"}; catch {http::cleanup $token} return "-1 $st"; } set htmldata [http::data $token]; http::cleanup $token #myputcmdlog "GetRDF: before regsub" regsub -all {\[} $htmldata {(} htmldata regsub -all {\]} $htmldata {)} htmldata if {[string match -nocase "**" $htmldata]} { putcmdlog "\002GetRDF\002 htmlsite $site" return "-1 Error 410 gone" } putcmdlog "GetRDF: site:$site; hdata30:[string range $htmldata 0 29];" set htmldata [html2text $htmldata] while {[regexp {^.*(&#\d+;).*$} $htmldata "" found]} { #putcmdlog "found $found" regexp {&#(\d+);} $found "" temp; set temp [string trimleft $temp " 0"]; #putcmdlog "set temp $temp" if {$temp==""} {set temp 0} set repl "" if {[string is digit $temp]} { set repl [format %c $temp] #putcmdlog "set replace $repl" } { #putcmdlog "remove $found ($temp), no digit" } set pos [lsearch [split $htmldata] *$found*] #putcmdlog "set pos $pos" if {$pos<0} {break} while {$pos>=0} { set htmldata [join [lreplace [split $htmldata] $pos $pos $repl]] set pos [lsearch [split $htmldata] *$found*] #putcmdlog "newtext: $found $pos $repl" } } set htmldata [html2text $htmldata] #myputcmdlog "GetRDF: return" return $htmldata } proc CatchInfo { data {sitename ""} } { set lines [split $data \n] set item 0; set title 0; set link 0; set desc 0; set newlines [list] #myputcmdlog "Sitename: $sitename" #myputcmdlog "Catch-Data: $data" foreach line $lines { if {([string match -nocase "*.*} $it it Title] { #putcmdlog "Titel1: $Title" set title 1; regsub -all {\{|\}} $Title {} Title regexp {!\(CDATA\((.+?)\)\)} $Title "" Title #putcmdlog "Titelx: $Title" #regexp {!\(CDATA(.+?)\)\>} $Title "" Title #putcmdlog "Titelx: $Title" set Title [string range $Title [expr [string first ">" $Title]+1] end]; lappend nitem "Title [string trim $Title]" #putcmdlog "Titel2: $Title" } {set Title ""} if {[regexp -nocase {^.*.*} $it it Link] || [regexp -nocase {^.*.*} $it it Link] || [regexp -nocase {^.*.*} $it it Link]} { #putlog "Link1: $Link" set link 1; regsub -all {\{|\}} $Link {} Link regexp {\!\(CDATA\((.+?)\)\)} $Link "" Link #regexp {\<\!\(CDATA(.+?)\)\>} $Link "" Link # set Link [string map {{ } { }} $Link] set Link [string range $Link [expr [string first ">" $Link]+1] end]; lappend nitem "Link [string trim $Link]" #putlog "Link2: $Link" } {set Link ""} if [regexp -nocase {^.*.*} $it it Desc] { #putlog "Desc1: $Desc" set desc 1; regsub -all {\{|\}} $Desc {} Desc regexp {\!\(CDATA\((.+?)\)\)} $Desc "" Desc #regexp {^\>\<\!\(CDATA(.+?)\)\>} $Desc "" Desc set Desc [string range $Desc [expr [string first ">" $Desc]+1] end]; regsub -all {<.+?>} $Desc {} Desc regexp {^(.+?)\(Weiter lesen\)} $Desc "" Desc lappend nitem "Desc [string trim $Desc]" #putlog "Desc2: $Desc" } {set Desc ""} lappend ret $nitem } #myputcmdlog "CatchInfo: before regsub" #putcmdlog "ret:'$ret';" #regsub -all $htmldata "\Ã\¼" htmldata {ü} regsub -all {\"} $ret {\'} ret regsub -all {\[} $ret {(} ret regsub -all {\]} $ret {)} ret #regsub -all {\{} $ret {(} ret #regsub -all {\}} $ret {)} ret regsub -all {ä} $ret {ae} ret regsub -all {ö} $ret {oe} ret regsub -all {ü} $ret {ue} ret regsub -all {Ä} $ret {Ae} ret regsub -all {Ö} $ret {Oe} ret regsub -all {Ü} $ret {Ue} ret regsub -all {"} $ret {\'} ret regsub -all {>} $ret {>} ret regsub -all {<} $ret {<} ret regsub -all {\&\#38;} $ret {\&} ret regsub -all {\&\#39;} $ret {\'} ret #myputcmdlog "CatchInfo: return" return $ret #return $newlines } proc Timer { { args "" } } { # set pos [lsearch $::RDF::Sites Tagesschau*] # if {0 && $pos>5 && $pos<[llength $::RDF::Sites]-5} { # putcmdlog "pos is $pos, put tagesschau to begin" # set last [lindex $::RDF::Sites $pos] # set ::RDF::Sites [lreplace $::RDF::Sites $pos $pos] # set ::RDF::Sites [linsert $::RDF::Sites 0 $last] # } for {set i 5} {$i<56} {incr i 30} { #putcmdlog "timer $i" utimer $i [list [namespace current]::Timer2 $args] } #Timer2 $args } proc Timer2 { { args "" } } { set Site [lindex $RDF::Sites 0]; set RDF::Sites [lreplace $RDF::Sites 0 0]; lappend RDF::Sites $Site if {![info exist RDF::Last([lindex $Site 0])]} { set RDF::Last([lindex $Site 0]) "" } #myputcmdlog "RDF::GetRDF $Site; args:$args;" if {![info exists ::RDF::Last(Timer2)]} {set ::RDF::Last(Timer2) 0} if {[clock seconds]-$::RDF::Last(Timer2)<15} { #putcmdlog "\002News-RDF\002: too fast retry $Site"; return } set ::RDF::Last(Timer2) [clock seconds] set Sitename [lindex $Site 0] set statime [clock seconds] set data [split [RDF::GetRDF [lindex $Site 1] [lindex $Site 0]] \n]; set midtime [clock seconds] set arg0 [lindex $data 0] set Title ""; set Link ""; set Desc ""; #if {[lindex $Site 0]=="debian.org"} {myputcmdlog "RDF::Debian 0"} putcmdlog "0Timer2:args:$args; arg0:[lrange [split $arg0 " \t\n\r"] 0 4]([lindex [split $arg0 " \t\n\r"] 2]([string is integ -stric [lindex [split $arg0 " \t\n\r"] 2]])); data:[string range $data 0 19]; " set errn [lindex [split $arg0 " \t\n\r"] 2] if {$errn==""} { } set redir 0 if {[string is integ -stric $errn]} { #putcmdlog "1Timer2:args:$args; [lrange [split $arg0 " \t\n\r"] 0 4] " set newloc "" foreach {n v} [array get ::laststate] { # if {$n=="body"} {continue} if {$n=="meta"} { \ foreach {n2 v2} $v { if {$n2=="Location"} { #putcmdlog "meta-n:$n2; v:$v2;" #putcmdlog "meta new location: $v2" set newloc $v2 } { #putcmdlog "meta-n:$n2; v:$v2;" } if {$errn=="500" || $errn=="404" || $errn=="410"} { putcmdlog "remove $errn: [lsearch -exact $::RDF::Sites "$Sitename [lindex $Site 1]"]; [lindex $Site 1]" set ::RDF::Sites [lreplace $::RDF::Sites [set remp [lsearch -glob $::RDF::Sites "$Sitename [lindex $Site 1]"]] $remp] break } if {$newloc!="" && $errn=="301" || $errn=="302" || $errn=="4xx" } { if {$newloc==""} { } { set redir 1 putcmdlog "Site $errn: $Sitename moved to $newloc; [lsearch -glob $::RDF::Sites "$Sitename [lindex $Site 1]"]" set ::RDF::Sites [lreplace $::RDF::Sites [set remp [lsearch -glob $::RDF::Sites "$Sitename [lindex $Site 1]"]] $remp "$Sitename $newloc"] set newloc "" } } }; continue \ } ## putcmdlog "n:$n; v:$v;" } } { # putcmdlog "Timer2:args:$args; " } if {[string is int $errn]} { #putcmdlog "errn:$errn; redir:$redir; ($Sitename); arg0:$arg0; " } { } set endtime [clock seconds] if {$endtime-$statime>2} { putcmdlog "\002News-RDF\002: need [expr {$endtime-$statime}] seconds for [lindex $Site 0]; ([expr {$midtime-$statime}]/[expr {$endtime-$midtime}]) data:([string len $data]/[llength $data])" if {$endtime-$statime>30} { putcmdlog "\002News-RDF\002: need very big time" putcmdlog "\002News-RDF\002: [lsearch -exact $::RDF::Sites "$Sitename [lindex $Site 1]"]; S:$Sitename [lindex $Site 1];" set ::RDF::Sites [lreplace $::RDF::Sites [set remp [lsearch -glob $::RDF::Sites "$Sitename [lindex $Site 1]"]] $remp] } } { putcmdlog "News-RDF: need [expr {$endtime-$statime}] seconds for [lindex $Site 0]; ([expr {$midtime-$statime}]/[expr {$endtime-$midtime}]) data:([string len $data]/[llength $data])" } if {$arg0!="-1" && $arg0!="-2" && $redir!="1"} { putcmdlog "check post: $Sitename; is int:[string is int $errn]; 00:[expr {![string is int $errn]}]; 01:[expr {![string is int -strict $errn]}]" myputcmdlog "Timer: data20 '[string range $data 0 19]';" set allinfo [RDF::CatchInfo [join $data \n] [lindex $Site 0]] #return #myputcmdlog "Timer: info '$info';" if {$allinfo!=""} { putcmdlog "allinfo:'[string range $allinfo 0 49]'([string len $allinfo]);" } set count 0; set skip 0; set initpost 0 variable initfnews #set allinfo [lrange $allinfo 0 9] if {$allinfo!=""} { savefile "dat.AllInfo" [list $Site $allinfo] } foreach info $allinfo { # putcmdlog "new item for info - $count/$skip/[llength $allinfo] - '[lindex $Site 0]' == '$info'" foreach content $info { # putcmdlog "Timer: content '[lindex $content 0]' - '[join [lrange $content 1 end]]';" set [lindex $content 0] [join [lrange $content 1 end]] } #continue set NDesc "" foreach CHKLink [list *0,1185,OID4961768_REF1,00.htm* *0,1185,OID4959806_REF1,00.htm* *0,1185,OID4992048_REF1,00.* *0,1185,OID4987634_REF1,00.* *0,,OID5234004,00.html* *0,1185,OID5236104_REF1,00.html* *wm2006/wm/?rdf=ts* *ard.de/sp/layout/php/ticker/index.phtml?tid=953* *export/ard-fussball/0,,1,00.xml* *sp/layout/php/ticker/index.phtml* *wm2006/wm/news2006* *export/ard-fussball*] { if [string match $CHKLink $Link] { continue } } # putcmdlog "chk1 $Sitename" savefile "dat.LastNews" [array get RDF::Last] set Title [stripcodes bcruag $Title] set Desc [stripcodes bcruag $Desc] set Link [stripcodes bcruag $Link] set Desc [string map [list "FAZ.NET - Homepage | Politik | Gesellschaft | Wirtschaft | Finanzmarkt | Sport | Feuilleton | Reise | Wissen | Auto | Computer" "" ] $Desc] if {$Title=="" && $Link==""} {incr skip; continue} if {$Title=="" || $Link==""} { #putcmdlog "clean title or link, t:$Title, l:$Link"; incr skip continue} set cont 0 if {$Link!=""} { if {![info exi ::LastSiteLinks($Sitename)]} {set ::LastSiteLinks($Sitename) [list]} if {[lsearch -exact $::LastSiteLinks($Sitename) $Link]!=-1} { #putcmdlog "Same Link $Sitename / Link: $Link / Title: $Title" set cont 1 } lappend ::LastSiteLinks($Sitename) $Link set ::LastSiteLinks($Sitename) [lrange $::LastSiteLinks($Sitename) end-249 end] if {![info exi ::LastSiteLinks(All)]} {set ::LastSiteLinks(All) [list]} if {[lsearch -exact $::LastSiteLinks(All) $Link]!=-1} { #putcmdlog "Same All Link $Sitename / Link: $Link / Title: $Title" set cont 1 } lappend ::LastSiteLinks(All) $Link set ::LastSiteLinks(All) [lrange $::LastSiteLinks(All) end-999 end] } if {$Title!=""} { if {![info exi ::LastSiteTitles($Sitename)]} {set ::LastSiteTitles($Sitename) [list]} if {[lsearch -exact $::LastSiteTitles($Sitename) $Title]!=-1} { #putcmdlog "Same Title $Sitename / Link: $Link / Title: $Title" set cont 1 } lappend ::LastSiteTitles($Sitename) $Title set ::LastSiteTitles($Sitename) [lrange $::LastSiteTitles($Sitename) end-249 end] if {![info exi ::LastSiteTitles(All)]} {set ::LastSiteTitles(All) [list]} if {[lsearch -exact $::LastSiteTitles(All) $Title]!=-1} { #putcmdlog "Same All Title $Sitename / Link: $Link / Title: $Title" set cont 1 } lappend ::LastSiteTitles(All) $Title set ::LastSiteTitles(All) [lrange $::LastSiteTitles(All) end-999 end] } if {$Desc!=""} { if {![info exi ::LastSiteDescs($Sitename)]} {set ::LastSiteDescs($Sitename) [list]} if {[lsearch -exact $::LastSiteDescs($Sitename) $Desc]!=-1} { #putcmdlog "Same Desc $Sitename / Link: $Link / Title: $Title" set cont 1 } lappend ::LastSiteDescs($Sitename) $Desc set ::LastSiteDescs($Sitename) [lrange $::LastSiteDescs($Sitename) end-249 end] if {![info exi ::LastSiteDescs(All)]} {set ::LastSiteDescs(All) [list]} if {[lsearch -exact $::LastSiteDescs(All) $Desc]!=-1} { #putcmdlog "Same All Desc $Sitename / Link: $Link / Title: $Title" set cont 1 } lappend ::LastSiteDescs(All) $Desc set ::LastSiteDescs(All) [lrange $::LastSiteDescs(All) end-999 end] } if {[lindex $Site 0]=="NetNewsGlobal"} { set Desc "" } if {[string len $Desc]<20} { set Desc "" } putcmdlog "chk9 $Sitename; cont:$cont; skip:$skip; Title:$Title;" if {![info exi ::FirstSite($Sitename)]} { putcmdlog "Not-Post [lindex $Site 0] - $count/$skip/[llength $allinfo] - $Title - $Link - $Desc" set cont 1 } if {$cont} {incr skip; continue} incr count if {[info exists initfnews([lindex $Site 0])]} { if {$count>5} { putcmdlog "too many output; [llength $RDF::Sites]; [lindex $RDF::Sites end]" # continue if {$Site==[lindex $RDF::Sites end]} { set RDF::Sites [lreplace $RDF::Sites end end]; set RDF::Sites [linsert $RDF::Sites 5 $Site] putcmdlog "move to front; [llength $RDF::Sites];" } if {$Link!=""} {set ::LastSiteLinks($Sitename) [lreplace $::LastSiteLinks($Sitename) end end]} if {$Title!=""} {set ::LastSiteTitles($Sitename) [lreplace $::LastSiteTitles($Sitename) end end]} if {$Desc!=""} {set ::LastSiteDescs($Sitename) [lreplace $::LastSiteDescs($Sitename) end end]} break } putcmdlog "\002Post\002 [lindex $Site 0] - $count/$skip/[llength $allinfo] - $Title - $Link" } { utimer 15 [list set [namespace current]::initfnews([lindex $Site 0]) 1] putcmdlog "ignore first post on $Site - $count/$skip/[llength $allinfo] - [namespace current];" continue } set OLink $Link if {[string match -nocase "Morgenpost*" [lindex $Site 0]]} { set Link [string map [list "www." "m."] $Link] } if {[set NLink [make_tinyurl $Link]]!=0} { set Link $NLink; } #continue if {[string match -nocase "*digit*" [lindex $Site 0]]} { if {[string match *c* [lindex [split [getchanmode #d-box]] 0]]} { putnews #d-box "([lindex $Site 0]) $Title - ${Link}" } { putnews #d-box "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } continue } if {[string match -nocase "*berlin*" [lindex $Site 0]] || [string match -nocase "*berlin*" $Title]} { set berlin 1 if {[string match *c* [lindex [split [getchanmode #berlin]] 0]]} { putnews #berlin "([lindex $Site 0]) $Title - ${Link}" } { putnews #berlin "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } { set berlin 0 } if {$info!="" && $RDF::Last([lindex $Site 0])!=$Title && ![string match *0,1185,OID4992048_REF1,00.ht* $Link]} { if {[string match -nocase "Morgenpost*" [lindex $Site 0]] || [lindex $Site 0]=="Hauptstadtblog" || [lindex $Site 0]=="Morgenpost-Berlin" || [lindex $Site 0]=="Berlin-Journal" || [lindex $Site 0]=="tip"} { if {[string match -nocase "Morgenpost*" [lindex $Site 0]]} { set Link [string map [list "www." "mobile."] $Link] } if {!$berlin} { set berlin 1 if {[string match *c* [lindex [split [getchanmode #berlin]] 0]]} { if {$NDesc!=""} { putnews #berlin "([lindex $Site 0]) $Title - ${Link}" #putnews #cybex.test "${Desc}" } { putnews #berlin "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #berlin "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" #putnews #cybex.test "${Desc}" } { putnews #berlin "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[lindex $Site 0]!="Morgenpost"} {continue} } if {[lindex $Site 0]=="LFM-CyBex" || [lindex $Site 0]=="" || [lindex $Site 0]==""} { putnews #cybex.test "T:$Title - D:$Desc - OL::$OLink - L:${Link}" continue } if {[lindex $Site 0]=="LFSNews" || [lindex $Site 0]=="LFS-News" || [lindex $Site 0]=="Speedmaniacs" || [lindex $Site 0]=="LFSxxx"} { if {[string match *c* [lindex [split [getchanmode #l4s]] 0]]} { if {$NDesc!=""} { putnews #l4s "([lindex $Site 0]) $Title - ${Link}" #putnews #cybex.test "${Desc}" } { putnews #l4s "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #l4s "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" #putnews #cybex.test "${Desc}" } { putnews #l4s "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } continue } if {[lindex $Site 0]=="xTagesschau" || [lindex $Site 0]=="BerlinOnline" || [string match -noc BerlinOnline-* [lindex $Site 0]]} { if {!$berlin} { if {[string match *c* [lindex [split [getchanmode #berlin]] 0]]} { if {$NDesc!=""} { putnews #berlin "([lindex $Site 0]) $Title - ${Link}" #putnews #berlin "${Desc}" } { putnews #berlin "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #berlin "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" #putnews #berlin "${Desc}" } { putnews #berlin "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[lindex $Site 0]!="Tagesschau"} {continue} } if {[lindex $Site 0]=="Quake.de" || [lindex $Site 0]=="derQuaker" } { if {[string match *c* [lindex [split [getchanmode #quake.de]] 0]]} { if {$NDesc!=""} { putnews #quake.de "([lindex $Site 0]) $Title - ${Link}" putnews #quake.de "${Desc}" } { putnews #quake.de "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #quake.de "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #quake.de "${Desc}" } { putnews #quake.de "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[lindex $Site 0]=="Quake.de" || [lindex $Site 0]=="derQuaker" } { if {[string match *c* [lindex [split [getchanmode #esl.quakelive.de]] 0]]} { if {$NDesc!=""} { putnews #esl.quakelive.de "([lindex $Site 0]) $Title - ${Link}" putnews #esl.quakelive.de "${Desc}" } { putnews #esl.quakelive.de "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #esl.quakelive.de "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #esl.quakelive.de "${Desc}" } { putnews #esl.quakelive.de "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {0 && [lindex $Site 0]=="Quake.de" || [lindex $Site 0]=="derQuaker" } { if {[string match *c* [lindex [split [getchanmode #qlpickup.eu]] 0]]} { if {$NDesc!=""} { putnews #qlpickup.eu "([lindex $Site 0]) $Title - ${Link}" putnews #qlpickup.eu "${Desc}" } { putnews #qlpickup.eu "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #qlpickup.eu "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #qlpickup.eu "${Desc}" } { putnews #qlpickup.eu "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[lindex $Site 0]=="Quake.de" || [lindex $Site 0]=="derQuaker" } { if {[string match *c* [lindex [split [getchanmode #DerQuaker]] 0]]} { if {$NDesc!=""} { putnews #DerQuaker "([lindex $Site 0]) $Title - ${Link}" putnews #DerQuaker "${Desc}" } { putnews #DerQuaker "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #DerQuaker "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #DerQuaker "${Desc}" } { putnews #DerQuaker "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[lindex $Site 0]=="Quake.de" || [lindex $Site 0]=="derQuaker"} { if {[string match *c* [lindex [split [getchanmode #bw.clan]] 0]]} { if {$NDesc!=""} { putnews #bw.clan "([lindex $Site 0]) $Title - ${Link}" putnews #bw.clan "${Desc}" } { putnews #bw.clan "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #bw.clan "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #bw.clan "${Desc}" } { putnews #bw.clan "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[lindex $Site 0]=="Quake.de" || [lindex $Site 0]=="derQuaker"} { if {[string match *c* [lindex [split [getchanmode #PlaymateZ.de]] 0]]} { if {$NDesc!=""} { putnews #PlaymateZ.de "([lindex $Site 0]) $Title - ${Link}" putnews #PlaymateZ.de "${Desc}" } { putnews #PlaymateZ.de "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #PlaymateZ.de "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #PlaymateZ.de "${Desc}" } { putnews #PlaymateZ.de "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {0 && [lindex $Site 0]=="derQuaker" } { if {[string match *c* [lindex [split [getchanmode #quake.de]] 0]]} { if {$NDesc!=""} { putnews #spontanctf "([lindex $Site 0]) $Title - ${Link}" putnews #spontanctf "${Desc}" } { putnews #spontanctf "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #spontanctf "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #spontanctf "${Desc}" } { putnews #spontanctf "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[string eq Formel1 [lindex $Site 0]] || [string match -nocase Motorsport* [lindex $Site 0]] || [string match -nocase "MST-*" [lindex $Site 0]] || [string match -nocase "MSM-*" [lindex $Site 0]] || [string match -nocase "AMS-*" [lindex $Site 0]] || [string match -nocase "AutoMot*" [lindex $Site 0]]|| [string match -noc *Formula* [lindex $Site 0]] || [string match -noc *itv-f1* [lindex $Site 0]] || ([string match -noc *SPOX* [lindex $Site 0]] && ([string match -noc *Formel*1* $Title] || [string match -noc *F1* $Title]))} { putcmdlog "Check F1: [lindex $Site 0]" if {[string match *c* [lindex [split [getchanmode #l4s]] 0]]} { putnews #l4s "([lindex $Site 0]) $Title - ${Link}" } { putnews #l4s "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } if {[string match *c* [lindex [split [getchanmode #formel1]] 0]]} { if {[botisop #formel1] && ([string match -nocase *form* [lindex $Site 0]] || [string match -nocase *form* $Title])} { putnewstopic #formel1 "([lindex $Site 0]) $Title - ${Link}" } { putnews #formel1 "([lindex $Site 0]) $Title - ${Link}" } } { if {[botisop #formel1] && [string match -nocase *form* [lindex $Site 0]]} { putnewstopic #formel1 "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } { putnews #formel1 "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[string eq KQE [lindex $Site 0]] || [string eq GulliNews [lindex $Site 0]] || [string eq Titanic [lindex $Site 0]]} { if {[string match *c* [lindex [split [getchanmode #grandprixlegends]] 0]]} { if {$NDesc!=""} { putnews #grandprixlegends,#cybex "([lindex $Site 0]) $Title - ${Link}" putnews #grandprixlegends,#cybex "${Desc}" } { putnews #grandprixlegends,#cybex "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #grandprixlegends,#cybex "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #grandprixlegends,#cybex "${Desc}" } { putnews #grandprixlegends,#cybex "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {![string eq BerlinOnline [lindex $Site 0]] && [string match -noc *berlin* $Title] || [string match -noc *berlin* $NDesc] || ([string match BerlinOnline* [lindex $Site 0]] && ![string eq BerlinOnline [lindex $Site 0]])} { if {[string match *c* [lindex [split [getchanmode #berlin.intern]] 0]]} { if {$NDesc!=""} { putnews #berlin.intern "([lindex $Site 0]) $Title - ${Link}" putnews #berlin.intern "${Desc}" } { putnews #berlin.intern "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #berlin.intern "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #berlin.intern "${Desc}" } { putnews #berlin.intern "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[string match -noc *kreuzberg* $Title] || [string match -noc *kreuzberg* $NDesc]} { if {[string match *c* [lindex [split [getchanmode #kreuzberg]] 0]]} { if {$NDesc!=""} { putnews #kreuzberg "([lindex $Site 0]) $Title - ${Link}" putnews #kreuzberg "${Desc}" } { putnews #kreuzberg "([lindex $Site 0]) $Title - ${Link}" } } { if {$NDesc!=""} { putnews #kreuzberg "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" putnews #kreuzberg "${Desc}" } { putnews #kreuzberg "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } } if {[lindex $Site 0]!="itn.com" \ && ![string match itv-* [lindex $Site 0]] \ && ![string match Formula1-* [lindex $Site 0]] \ && ![string match BBC-* [lindex $Site 0]] \ && ![string match CNN-* [lindex $Site 0]] \ && ![string match Newsweek [lindex $Site 0]] \ && ![string match WP-* [lindex $Site 0]] \ && ![string match USA-* [lindex $Site 0]] \ && ![string match News-* [lindex $Site 0]] \ && ![string match UK-* [lindex $Site 0]] \ && ![string match DP-* [lindex $Site 0]] \ && ![string match BerlinOnline* [lindex $Site 0]] \ && ![string match -nocase Motorsport* [lindex $Site 0]] \ && ![string match NY-Tim* [lindex $Site 0]]} { SendBot "(\002[lindex $Site 0]\002) $Title - \037$Link\037" } set RDF::Last([lindex $Site 0]) $Title if [info exists Desc] { if {$Desc!=""} { if {![info exist RDF::LastDesc([lindex $Site 0])]} { set RDF::LastDesc([lindex $Site 0]) "" } if {$RDF::LastDesc([lindex $Site 0])!=$Desc} { savefile "dat.LastDesc" [array get RDF::LastDesc] if {[lindex $Site 0]!="itn.com" \ && ![string match itv-* [lindex $Site 0]] \ && ![string match Formula1-* [lindex $Site 0]] \ && ![string match BBC-* [lindex $Site 0]] \ && ![string match CNN-* [lindex $Site 0]] \ && ![string match Newsweek [lindex $Site 0]] \ && ![string match WP-* [lindex $Site 0]] \ && ![string match USA-* [lindex $Site 0]] \ && ![string match News-* [lindex $Site 0]] \ && ![string match UK-* [lindex $Site 0]] \ && ![string match DP-* [lindex $Site 0]] \ && ![string equal BerlinOnline [lindex $Site 0]] \ && ![string match -nocase Motorsport* [lindex $Site 0]] \ && ![string match NY-Tim* [lindex $Site 0]]} { putnews "#news.de" "$Desc" } set RDF::LastDesc([lindex $Site 0]) $Desc set NDesc $Desc; #set Desc " - $Desc" } } } { set Desc ""; set NDesc "" } if {[lindex $Site 0]!="itn.com" \ && ![string match itv-* [lindex $Site 0]] \ && ![string match BBC-* [lindex $Site 0]] \ && ![string match CNN-* [lindex $Site 0]] \ && ![string match Newsweek [lindex $Site 0]] \ && ![string match WP-* [lindex $Site 0]] \ && ![string match USA-* [lindex $Site 0]] \ && ![string match News-* [lindex $Site 0]] \ && ![string match UK-* [lindex $Site 0]] \ && ![string match DP-* [lindex $Site 0]] \ && ![string match NY-Tim* [lindex $Site 0]]} { } { if {$NDesc!=""} { putnews #news "(\002[lindex $Site 0]\002) $Title - \037${Link}\037 - ${Desc}" } { putnews #news "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } } #putcmdlog "\002site:\002[lindex $Site 0]; \002Title:\002$Title;" #if {[lindex $Site 0]=="Tagesschau" || [lindex $Site 0]=="heise.de"} if {[lindex $Site 0]=="winfuture" || [lindex $Site 0]=="Gamestar" || [lindex $Site 0]=="Golem-Hardware" || [lindex $Site 0]=="Golem-Enter"} { putnews #vain.com "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" } #if {[lindex $Site 0]=="N24" || [lindex $Site 0]=="Gamestar"} { # putnews #esm "(\002[lindex $Site 0]\002) $Title - \037${Link}\037" #} if {[info exists Desc] && $Desc!=""} { #myputlog "New News: ([lindex $Site 0]) $Title - \037${Link}\037 - ${Desc}" } { #myputlog "New News: ([lindex $Site 0]) $Title - \037${Link}\037" } } { #putnews "#news.de" "Old [lindex $Site 0] News> $Title - $Link" #if [info exists Desc] { putnews "#news.de" "$Desc" } } } set ::FirstSite($Sitename) 1 } { #putnews "#cybex.test" "$arg0 - $data" } } # --- init --- set Devel 0; set Debug 15; if {![info exist Ver]} {set Ver ""} proc GetAll {} { ::RDF::Randomize ::RDF::Randomize set i 0 foreach site $::RDF::Sites { incr i utimer [expr {$i*10}] ::RDF::Timer2 } } proc Rehash {} { if {[info exist ::botnet-nick]} { if {${::botnet-nick}=="NewsFlash"} { set RDF::Devel 1 } } if {[info exist RDF::Ver] && $RDF::Devel && $RDF::Ver!=""} { set ver [split $RDF::Ver .]; set ver [lreplace $ver 2 2 [expr [lindex $ver 2]+1]]; set RDF::Ver [join $ver .]; myputcmdlog "Rehashed to version $RDF::Ver" } { set data [loadfile "dat.LastNews"] if {$data!=""} {array set RDF::Last $data} set data [loadfile "dat.LastDesc"] if {$data!=""} {array set RDF::LastDesc $data} set RDF::Ver "0.4.31" myputlog "RDF version $RDF::Ver by CyBex loaded" } GetAll return "$RDF::Ver"; } bind time - "*" RDF::Timer; catch { unbind time - "**" RDF::Timer; unbind time - "* *" RDF::Timer; unbind time - "****" RDF::Timer; unbind time - "* * *" RDF::Timer; unbind time - "******" RDF::Timer; unbind time - "* * * *" RDF::Timer; unbind time - "********" RDF::Timer; unbind time - "* * * * *" RDF::Timer; } bind time - "30 *" RDF::Randomize bind time - "00 *" RDF::Randomize } # ----------------------------------------------------------------------------- # Name : make_tinyurl # Purpose : Does the actual conversion # ----------------------------------------------------------------------------- package req ncgi proc make_tinyurl { arg args } { set url [http::formatQuery $arg] if {[catch {set page [::http::geturl http://tinyurl.com/create.php?url=${url}]}]} {putcmdlog "tinyurl: geturl '$arg' failed"; return 0} if {[catch {set lines [split [::http::data $page] \n]}]} {putcmdlog "tinyurl: http data failed"; return 0} if {[catch {::http::cleanup $page}]} {putcmdlog "tinyurl: cleanup failed"; return 0} if {[regexp {"copyinfo" data-clipboard-text="(.+?)"} $lines "" url]} { return $url } set fh [open "tinyurl.html" w] puts $fh [join $lines \n] close $fh putcmdlog "tinyurl: regexp failed" return "0" } return [RDF::Rehash]