All pastes #736433 Raw Edit

Someone

public python v1 · immutable
·published 2007-10-14 15:10 UTC
rendered paste body
package require http;package require uri;proc r1 ra { upvar #0 [r3 $ra] 1a;if ![info exists 1a(body)] {set 1a(body) ""};set 1f 0;foreach {1b 1c} [r2 $1a(body)] {switch -- $1b {<title> {set 1d $1c} <link> { set 1e $1c } </item> {print "\00313 $1f# \00307 $1e - \00305 $1d";set 1f [ expr {$1f + 1} ] }}}} proc r2 rb {set 2a "";set 2b {(<[^>]+>) *([^<>]*)};foreach {all 2c 2d} [regexp -all -inline $2b $rb] {if {![regexp src= $2d]} {lappend 2a $2c $2d}};string map {Ü Ãœ ß ÃŸ ä ä ö ö ü ü „ ' “ ' &auml; ä &ouml; ö &uuml; ü &szlig; ß &nbsp; ""} $2a};proc r3 rc {array set URI [::uri::split $rc]; while {1} {set 3a [eval [list http::geturl $rc]];if {![string match {30[1237]} [::http::ncode $3a]]} {return $3a};array set meta [set ${3a}(meta)];if {![info exist meta(Location)]} {return $3a}array set uri [::uri::split $meta(Location)];unset meta;if {$uri(host) == ""} {set uri(host) $URI(host)}set rc [eval ::uri::join [array get uri]]}};alias rss {if {![file exists rss.list]} {exit};set r1 [open rss.list {RDONLY}]; set r2 [gets $r1];set r3 [clock format [clock sec] -format {%Y-%m-%d, %H:%M:%S}]while {$r2 != ""} {print "\00303 $r2 - $r3";print "";print [r1 $r2];set r2 [gets $r1]}};complete }