# HG changeset patch # User Matti Hamalainen # Date 1613755853 -7200 # Node ID f46c152183a280e7432b6457d9ecb6aa53c2c08f # Parent 7192d94f8c281d8e85e88343f4671d0e6289831b fetch_feeds: Use generic HTTP request handling code also for RSS feed fetches. diff -r 7192d94f8c28 -r f46c152183a2 fetch_feeds.tcl --- a/fetch_feeds.tcl Fri Feb 19 19:30:30 2021 +0200 +++ b/fetch_feeds.tcl Fri Feb 19 19:30:53 2021 +0200 @@ -124,6 +124,7 @@ proc add_entry {uname uprefix uurl utitle} { global currclock feeds_db nitems + set utmp [utl_convert_html_ent $uurl] if {[string match "http://*" $utmp] || [string match "https://*" $utmp]} { set utest "$utmp" @@ -149,12 +150,9 @@ proc add_rss_feed {datauri dataname dataprefix} { - if {[catch {set utoken [::http::geturl $datauri -binary 1 -timeout 6000 -headers {Accept-Encoding identity}]} uerrmsg]} { - puts "Error getting $datauri: $uerrmsg" - return 1 + if {![fetch_dorequest $datauri ustatus uscode ucode upage umeta]} { + return 0 } - set upage [::http::data $utoken] - ::http::cleanup $utoken set umatches [regexp -all -nocase -inline -- ".\*\?<..CDATA.(.\*\?)\\\]\\\]>.\*\?(http.\*\?).\*\?" $upage] set nmatches [llength $umatches]