RssTcl

From s23
Jump to navigation Jump to search

Please add some good URLs to RSS Newsfeeds here: (this helps Bh44L while scripting the Eggdrop TCL script)

http://mutante.s23.org/rssfeed023.tcl.txt

-- [14:15:56] <s23> Available sources: (not all working, maybe we can get a few more to work)

bugtraq: http://www.securityfocus.com/rss/vulnerabilities.xml
bverfg: http://www.bundesverfassungsgericht.de/rss/entscheidungen/
c4-wiki: http://wiki.koeln.ccc.de/index.php?title=Special:Recentchanges&feed=rss
chaos: http://www.ccc.de/updates/chaosupdates.rdf
cnn: http://www.cnn.com/cnn.rss
diewelt: http://www.welt.de/z/newsticker/ticker_welt.xml
fischlog: http://sakana.antville.org/rss
freshmeat: http://freshmeat.net/backend/fm-releases-software.rdf
gaim: http://gaim.sourceforge.net/rss.php/news
galaxy-news: http://www.galaxy-news.de/backend.php
golem: http://www.golem.de/golem_backend.rdf
heise: http://www.heise.de/newsticker/heise.rdf
heise-security: http://www.heise.de/security/news/news.rdf
heisemobil: http://www.heise.de/mobil/newsticker/heise.rdf
i-pobox: http://www.i-pobox.net/b2rdf.php
instantnirvana: http://concord.antville.org/rss
liberation: http://www.liberation.fr/rss.php
linuxfr: http://linuxfr.org/backend.rss
linuxtoday: http://linuxtoday.com/backend/biglt.rss
lsmods: http://www.loose-screws.com/backend/mods_heavy.xml
lwn: http://lwn.net/headlines/rss
migriblog: http://blog.migri.de/b2rdf.php
narzissmusverdacht: http://blubber.blogger.de/rss
neowin: http://neowin.net/backend.php?page=main
netzbuch: http://www.das-netzbuch.de/index.xml
netzeitung: http://www.netzeitung.de/export/news/rss/titelseite.xml
nofrag: http://www.nofrag.com/nofrag.rss
orf: http://rss.orf.at/news.xml
pcworld.com - latest news: http://rss.pcworld.com/rss/latestnews.rss
pro-linux: http://www.pl-forum.de/backend/pro-linux.rdf
rus-cert: http://CERT.Uni-Stuttgart.DE/ticker/rus-cert.rdf
s23-wiki: http://is-root.de/wiki/index.php?title=Special:Recentchanges&feed=rss
science: http://www.scienceticker.info/rss/RSS_File.xml
shellcity: http://www.shellcity.net/citynews.xml
slashdot: http://slashdot.org/slashdot.rss
sofa: http://arrog.antville.org/rss
spiegel.de: http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml
swr3: http://www.swr3.de/rdf-feed/
symlink: http://www.symlink.ch/symlinkch.rss
tagesschau: http://www.tagesschau.de/xml/tagesschau-meldungen/
thinknerd: http://www.thinknerd.de/?q=node/feed
utopia: http://www.utopiatemple.com/utopia-news.rss
webstandards: http://www.webstandards.org/buzz/buzz.xml
winfuture: http://media-designs.de/winfuture.rdf
xoops: http://www.xoops.org/backend.php
zeropage: http://www.zeropage.net/tmh/backend/tmh.rdf
zone-h: http://zone-h.org/en/rss/advisories
23 me BlOg: http://23.me.uk/atom/index.xml

--

example:

set rss_url(alias) "url"


set rss_url(s23) "http://wiki.s23.org/wiki.pl?RecenChanges&action=rss"
set rss_url(ccc) "http://www.ccc.de/updates/chaosupdates.rdf"
set rss_url(c4) "http://wiki.koeln.ccc.de/index.php?title=Special:Recentchanges&feed=rss"
set rss_url(/.) "http://slashdot.org/slashdot.rdf"
set rss_url(tagesschau) "http://www.tagesschau.de/xml/tagesschau-meldungen/"
set rss_url(nirvana) "http://concord.antville.org/rss"
set rss_url(fischlog) "http://sakana.antville.org/rss"
set rss_url(golem) "http://www.golem.de/golem_backend.rdf"
set rss_url(heise) "http://www.heise.de/newsticker/heise.rdf"
set rss_url(telepolis) "http://www.heise.de/tp/news.rdf"
set rss_url(heise-sec) "http://www.heise.de/security/news/news.rdf"
set rss_url(heise-mob) "http://www.heise.de/mobil/newsticker/heise.rdf"
set rss_url(i-pobox) "http://www.i-pobox.net/b2rdf.php"
set rss_url(migri) "http://blog.migri.de/b2rdf.php"
set rss_url(narziss) "http://blubber.blogger.de/rss"
set rss_url(neowin) "http://neowin.net/backend.php?page=main"
set rss_url(nofrag) "http://www.nofrag.com/nofrag.rss"
set rss_url(orf) "http://rss.orf.at/news.xml"
set rss_url(rus-cert) "http://CERT.Uni-Stuttgart.DE/ticker/rus-cert.rdf"
set rss_url(sofa) "http://arrog.antville.org/rss"
set rss_url(boston) "http://boston.craigslist.org/zip/index.rss"
set rss_url(berlin) "http://www.undergroundlondon.com/weather/world.rss/016/c00059?type=title"


Hm, here's the Script:

########################
#######RSS Reader#######
########################
########by BhaaL########
########################
package require http

####CONFIG AREA####
#Muster:
#set rss_url(alias) "url"
#alias kann beim Trigger verwendet werden, zb !rss heise
#url wird als die zu parsende RSS verwendet
set rss_url(s23) "http://wiki.s23.org/wiki.pl?RecenChanges&action=rss"
set rss_url(heise) "http://www.heise.de/tp/news.rdf"
set rss_url(c4) "http://koeln.ccc.de/cgi-bin/wiki.pl?RecentChanges&action=rss"
set rss_url(/.) "http://slashdot.org/slashdot.rdf"
####CONFIG ENDE####

bind pub - !rss rss:get

proc rss:get {nick host hand chan arg} {
global rss_url
set url [join [lindex [split $arg] 0]]
if {[info exists rss_url($url)]} {
set url $rss_url($url)
}
rss:read "$url" $chan
}

proc rss:read {url chan} {
set token [http::geturl $url -timeout 10000]
if {[http::status $token]=="timeout"} {
putmsg $chan "TimeOut beim verbinden!"
return 0
}
set data [http::data $token]
set page ""
set title ""
set link ""
set section "channel"
foreach line [split $data 
] {
if {$section == "channel"} {
###section channel start
if {$page == "" && [string match -nocase "*<title>*" $line]} {
set page [join [lindex [split [lindex [split $line >] 1] <] 0]]
}
if {[string match -nocase "*</channel>*" $line]} {
set section "after channel"
}
###section channel ende
}
###-----------------------
if {$section == "after channel"} {
###section after channel
if {[string match -nocase "*<item*" $line]} {
set section "item"
}
###section after channel
}
###----------------------
if {$section == "item"} {
###section item start
if {$link == "" && [string match -nocase "*<link*" $line]} {
set link [join [lindex [split [lindex [split $line >] 1] <] 0]]
break
}
if {$title == "" && [string match -nocase "*<title*" $line]} {
set title [join [lindex [split [lindex [split $line >] 1] <] 0]]
}
###section item ende
}
}
if {$title != "" && $link != ""} {
putmsg $chan "\002$page\002 $title: $link"
} else {
putmsg $chan "Fehler bei $url"
}
}
putlog "RSS-Reader (c) 2004 by BhaaL loaded"

Some Bits could be coded better, but this first Version works ;)