This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Eggdrop RSS Syndication (rss-synd) v0.5b1

Support & discussion of released scripts, and announcements of new releases.
Post Reply
a
assgier
Voice
Posts: 4
Joined: Mon Oct 04, 2004 9:54 pm

Post by assgier »

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: Select all

<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:
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!
s
scotteh
Halfop
Posts: 50
Joined: Sun Jan 29, 2006 12:43 am

Post by scotteh »

@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: Select all

incr tmp_num [regexp -all -- "<$tag_name\(|.\[^>\]+\)>" [string range $xml_data $last_tag_end_last $tag_end_last]]
and replace it with:

Code: Select all

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.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

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.
a
assgier
Voice
Posts: 4
Joined: Mon Oct 04, 2004 9:54 pm

Post by assgier »

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: Select all

incr tmp_num [regexp -all -- "<$tag_name\(|.\[^>\]+\)>" [string range $xml_data $last_tag_end_last $tag_end_last]]
and replace it with:

Code: Select all

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 :D
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.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

So it's not completed yet if it's a beta?
Idling at #Football, Quakenet.
s
scotteh
Halfop
Posts: 50
Joined: Sun Jan 29, 2006 12:43 am

Post by scotteh »

I'd suggest using v0.5b over v0.4, it's far more stable than any of the previous releases.
User avatar
MenzAgitat
Op
Posts: 118
Joined: Tue Jul 04, 2006 12:35 pm
Location: France
Contact:

Post by MenzAgitat »

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.
s
scotteh
Halfop
Posts: 50
Joined: Sun Jan 29, 2006 12:43 am

Post by scotteh »

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/
User avatar
MenzAgitat
Op
Posts: 118
Joined: Tue Jul 04, 2006 12:35 pm
Location: France
Contact:

Post by MenzAgitat »

It works perfectly, thank you.
User avatar
Anahel
Halfop
Posts: 48
Joined: Fri Jul 03, 2009 6:18 pm
Location: Dom!

Post by Anahel »

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?
x
x0x
Op
Posts: 140
Joined: Tue Feb 10, 2009 6:42 am

Post by x0x »

I installed the latest version from Google and get these on the console;

Code: Select all

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.
f
fewyn
Voice
Posts: 15
Joined: Tue Dec 28, 2004 4:11 pm

Post by fewyn »

RSS HTTP Error: http://www.worldofraids.com/wow-blue-tracker/0-all.xml (State: error)

Any ideas? I'm currently out of them :(
x
x0x
Op
Posts: 140
Joined: Tue Feb 10, 2009 6:42 am

Post by x0x »

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?
s
scotteh
Halfop
Posts: 50
Joined: Sun Jan 29, 2006 12:43 am

Post by scotteh »

@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
fewyn wrote:RSS HTTP Error: http://www.worldofraids.com/wow-blue-tracker/0-all.xml (State: error)

Any ideas? I'm currently out of them :(
Search for:

Code: Select all

	if {$state(status) != "ok"} {
		putlog "\002RSS HTTP Error\002: $state(url) (State: $state(status))"
		return 1
	}
And replace it with:

Code: Select all

	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...).
x
x0x
Op
Posts: 140
Joined: Tue Feb 10, 2009 6:42 am

Post by x0x »

Error error with the tinyurl patch.

I have set the following code:

Code: Select all

#
# 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: Select all

"output" "\\\[\002NEW\002\\\] @@item!title@@ - \[tinyurl @@item!link@@\]"


Error in the bot's console:

Code: Select all

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: Select all

\[NEW\] Article Title - [tinyurl http://url.to.article]
Help! :)
Post Reply