| View previous topic :: View next topic |
| Author |
Message |
assgier Voice
Joined: 04 Oct 2004 Posts: 4
|
Posted: Thu Mar 25, 2010 8:19 pm Post subject: |
|
|
I'm hoping this thread is still being followed by Andrew, after all these years (and the latest post being from december last year).
Been using rss-synd for ages! It's working very well and I'm really happy about it.
One thing though: it seems to have trouble recognising self-closing tags in XML. It's either that, or it just doesn't allow tags (with the same name?) contained in other tags.. This is causing an error when using feedburner.com-urls, at least the one I'm trying to have listed in my channel: http://feeds.feedburner.com/TEDTalks_video.
The piece of their output-XML, that's causing this problem:
| Code: |
<itunes:category text="Arts">
<itunes:category text="Design" />
</itunes:category>
<itunes:category text="Education">
<itunes:category text="Higher Education" />
</itunes:category>
<itunes:category text="Science & Medicine">
<itunes:category text="Natural Sciences" />
</itunes:category>
<itunes:category text="Technology" />
|
As you can see, there's several "<itunes:category>"-tags. Some of them contained in other "<itunes:category>"-tags, some of them self-closing.
The error rss-synd returns:
| Quote: |
RSS Malformed Feed: Tag not closed: "<itunes:category>"
|
I have tried playing around a bit in the source-code, but I can't get it fixed... That's why I'm now asking you: can you have this fixed?
Thanks in advance! |
|
| Back to top |
|
 |
scotteh Halfop
Joined: 29 Jan 2006 Posts: 50
|
Posted: Fri Mar 26, 2010 5:01 am Post subject: |
|
|
@assgier
You're right, the code couldn't handle self closing tags within a parent tag of the same name. Luckily its a very simple fix.
look for line:
| Code: | | incr tmp_num [regexp -all -- "<$tag_name\(|.\[^>\]+\)>" [string range $xml_data $last_tag_end_last $tag_end_last]] |
and replace it with:
| Code: | | incr tmp_num [regexp -all -- "<$tag_name\(\[\\s\\t\\n\\r\]+\(\[^/>\]*\)?\)?>" [string range $xml_data $last_tag_end_last $tag_end_last]] |
Edit: Fixed another bug in the regexp. |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Fri Mar 26, 2010 8:50 am Post subject: |
|
|
I`m a bit confused I looked through the script archieve and couldn't find this version, is it final & released?
IF so can someone post an update link to download it? _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
assgier Voice
Joined: 04 Oct 2004 Posts: 4
|
Posted: Fri Mar 26, 2010 12:09 pm Post subject: |
|
|
| scotteh wrote: | @assgier
You're right, the code couldn't handle self closing tags within a parent tag of the same name. Luckily its a very simple fix.
look for line:
| Code: | | incr tmp_num [regexp -all -- "<$tag_name\(|.\[^>\]+\)>" [string range $xml_data $last_tag_end_last $tag_end_last]] |
and replace it with:
| Code: | | incr tmp_num [regexp -all -- "<$tag_name\(\[\\s\\t\\n\\r\]+\(\[^/>\]*\)?\)?>" [string range $xml_data $last_tag_end_last $tag_end_last]] |
Edit: Fixed another bug in the regexp. |
That solved it! Thanks
| Football wrote: | I`m a bit confused I looked through the script archieve and couldn't find this version, is it final & released?
IF so can someone post an update link to download it? |
They are all here. The URL is mentioned in this topic's starting post. |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Fri Mar 26, 2010 1:43 pm Post subject: |
|
|
So it's not completed yet if it's a beta? _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
scotteh Halfop
Joined: 29 Jan 2006 Posts: 50
|
Posted: Sat Mar 27, 2010 3:56 am Post subject: |
|
|
| I'd suggest using v0.5b over v0.4, it's far more stable than any of the previous releases. |
|
| Back to top |
|
 |
MenzAgitat Op

Joined: 04 Jul 2006 Posts: 118 Location: France
|
Posted: Wed Mar 31, 2010 3:12 pm Post subject: |
|
|
You should use ::http::cleanup systematically (even if an error occurs) because after a long uptime, the memory is full of arrays that looks like $::http::561 and that contains the parsed web pages.
Thank you for this excellent script, I've been using it for years. |
|
| Back to top |
|
 |
scotteh Halfop
Joined: 29 Jan 2006 Posts: 50
|
Posted: Thu Apr 01, 2010 6:05 am Post subject: |
|
|
| MenzAgitat wrote: | You should use ::http::cleanup systematically (even if an error occurs) because after a long uptime, the memory is full of arrays that looks like $::http::561 and that contains the parsed web pages.
Thank you for this excellent script, I've been using it for years. |
Thanks, i've made the changes in the svn.
http://code.google.com/p/rss-synd/source/browse/trunk/ |
|
| Back to top |
|
 |
MenzAgitat Op

Joined: 04 Jul 2006 Posts: 118 Location: France
|
Posted: Thu Apr 01, 2010 8:03 am Post subject: |
|
|
| It works perfectly, thank you. |
|
| Back to top |
|
 |
Anahel Halfop

Joined: 03 Jul 2009 Posts: 48 Location: Dom!
|
Posted: Mon Apr 05, 2010 7:36 pm Post subject: |
|
|
| hi there, i use v0.5b rss-synd and i use it in several channels, but i wanted to add another one but bot doesn't announce news there, channel name is #top_secret so i think bot fails at "_" in it's name (I've channels with "." "-" in their name and there announce works fine), maybe you know how to solve this problem? |
|
| Back to top |
|
 |
x0x Op
Joined: 10 Feb 2009 Posts: 140
|
Posted: Mon Apr 12, 2010 1:56 pm Post subject: |
|
|
I installed the latest version from Google and get these on the console;
| Code: | RSS HTTP Error: URLTOFEED (HTTP/1.1 503 Service Temporarily Unavailable)
RSS Warning: couldn't open "./scripts/feeds/one.db": no such file or directory.
RSS Database Error: couldn't open "./scripts/feeds/one.db": permission denied. |
The feed is working fine in a new browser with cache emptied. |
|
| Back to top |
|
 |
fewyn Voice
Joined: 28 Dec 2004 Posts: 15
|
|
| Back to top |
|
 |
x0x Op
Joined: 10 Feb 2009 Posts: 140
|
Posted: Tue Apr 13, 2010 6:21 pm Post subject: |
|
|
Resolved my previous error, setting file permissions can do the trick
Is there some way to convert the long urls in some outputs to tinyurl or some other short url service automatically? |
|
| Back to top |
|
 |
scotteh Halfop
Joined: 29 Jan 2006 Posts: 50
|
Posted: Wed Apr 14, 2010 8:31 am Post subject: |
|
|
@x0x
| x0x wrote: | Resolved my previous error, setting file permissions can do the trick
Is there some way to convert the long urls in some outputs to tinyurl or some other short url service automatically? |
Check out Racle's post on the last page: http://forum.egghelp.org/viewtopic.php?p=92311#92311
@fewyn
Search for:
| Code: | if {$state(status) != "ok"} {
putlog "\002RSS HTTP Error\002: $state(url) (State: $state(status))"
return 1
} |
And replace it with:
| Code: | if {[set status $state(status)] != "ok"} {
if {$status == "error"} { set status $state(error) }
putlog "\002RSS HTTP Error\002: $state(url) (State: $status)"
::http::cleanup $token
return 1
} |
This should give you more information on what the exact error is.
@Anahel
| Anahel wrote: | | hi there, i use v0.5b rss-synd and i use it in several channels, but i wanted to add another one but bot doesn't announce news there, channel name is #top_secret so i think bot fails at "_" in it's name (I've channels with "." "-" in their name and there announce works fine), maybe you know how to solve this problem? |
I've tested this, and underscores in a channels name works. I'd double check the channel name and make sure there aren't any 'hidden' control codes in it (colour, bold, reverse, etc...). |
|
| Back to top |
|
 |
x0x Op
Joined: 10 Feb 2009 Posts: 140
|
Posted: Thu Apr 15, 2010 12:40 pm Post subject: |
|
|
Error error with the tinyurl patch.
I have set the following code:
| Code: | #
# Misc Functions
##
proc tinyurl {url} {
if {[info exists url] && [string length $url]} {
if {[regexp {http://tinyurl\.com/\w+} $url]} {
set http [::http::geturl $url -timeout 9000]
upvar #0 $http state ; array set meta $state(meta)
::http::cleanup $http ; return $meta(Location)
} else {
set http [::http::geturl "http://tinyurl.com/create.php" \
-query [::http::formatQuery "url" $url] -timeout 9000]
set data [split [::http::data $http] \n] ; ::http::cleanup $http
for {set index [llength $data]} {$index >= 0} {incr index -1} {
if {[regexp {href="http://tinyurl\.com/\w+"} [lindex $data $index] url]} {
return [string map { {href=} "" \" "" } $url]
}}}}
return ""
} |
+
| Code: | | "output" "\\\[\002NEW\002\\\] @@item!title@@ - \[tinyurl @@item!link@@\]" |
Error in the bot's console:
| Code: | | RSS Eval Error: Unknown option , can be: -binary, -blocksize, -channel, -command, -handler, -headers, -keepalive, -method, -myaddr, -progress, -protocol, -query, -queryblocksize, -querychannel, -queryprogress, -strict, -timeout, -type, -validate |
And channel output:
| Code: | | \[NEW\] Article Title - [tinyurl http://url.to.article] |
Help!  |
|
| Back to top |
|
 |
|