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

Post by scotteh »

RGhost wrote:Hi.

Can anyone help me to parse http://feeds.feedburner.com/CgIndia `?
I get "error" :

RSS Malformed Feed: Tag not closed: "<feed>"
RSS Error: Unable to parse feed properly, no data returned. "http://feeds.feedburner.com/CgIndia"
The problem was with one of my regular expressions if you replace the line:

Code: Select all

incr tmp_num [regexp -all -- "<$tag_name\(|.\[^>\]+\)>" [string range $xml_data $last_tag_end_last $tag_end_last]]
with this line (the only change is replacing a '.' with a space)

Code: Select all

incr tmp_num [regexp -all -- "<$tag_name\(| \[^>\]+\)>" [string range $xml_data $last_tag_end_last $tag_end_last]]
p
pennst26
Voice
Posts: 8
Joined: Fri May 12, 2006 2:06 pm

Post by pennst26 »

@Scotteh
Can you post some examples of how to filter results? My channel is being hammered with results from 30 Catgories, and I am interested in only 1
p
pennst26
Voice
Posts: 8
Joined: Fri May 12, 2006 2:06 pm

Post by pennst26 »

Code: Select all

<item><title>Spirit Of July</title>
<link>http://edited_rss.php/100072/</link>
<description>
Category: Anime 
 Size: 174.86 KB
 Added: 2008-07-10 03:13:19
 </description>
For example the above is the rss feed but me/my channel is only interested in one single category and at the moment it is spamming the hell out of my channel with all of them.
Show me how using eval-tcl I can weed these out please =D
thank you
s
scotteh
Halfop
Posts: 50
Joined: Sun Jan 29, 2006 12:43 am

Post by scotteh »

pennst26 wrote:

Code: Select all

<item><title>Spirit Of July</title>
<link>http://edited_rss.php/100072/</link>
<description>
Category: Anime 
 Size: 174.86 KB
 Added: 2008-07-10 03:13:19
 </description>
For example the above is the rss feed but me/my channel is only interested in one single category and at the moment it is spamming the hell out of my channel with all of them.
Show me how using eval-tcl I can weed these out please =D
thank you
Using eval-tcl will work, but it won't be pretty. i'll work out a eval-tcl for you, send me an email.

I was planning on adding some sort of filtering based on a predetermined set of rules as quite a few people have requested it.

Currently I'm doing some rather large changes (albeit slowly), cleaning up some code and putting the configuration into its own ini like file. Also toying with the idea of making it more modular, but I'm not sure it is big enough to justify it.
p
pennst26
Voice
Posts: 8
Joined: Fri May 12, 2006 2:06 pm

Post by pennst26 »

e-mail sent, thank you
b
bostik
Voice
Posts: 1
Joined: Thu Aug 21, 2008 1:36 am

Post by bostik »

Hi,

This is great script, i just love it!

But is there a way to announce new RSS results as numbers, not in text?

For example:

<bot> sitename.com has <number> new entries.

So, it would need counting new rss results. I do handle some scripting myself, but this is out of my league.

Thanks in advance :)
User avatar
MenzAgitat
Op
Posts: 118
Joined: Tue Jul 04, 2006 12:35 pm
Location: France
Contact:

Post by MenzAgitat »

As described here, same old problem occured again today.

While trying to fetch Imaginascience's RSS feed, max CPU usage and RAM is filling until there's no ressources left.

Here is the RSS feed content that caused the problem : rss

I'm still using v0.4 because I modified it to display tinyurls and a list of available rss feeds when using !rss with no arguments, and I'm a bit lazy to do the same thing on v0.5b1 at the moment.
(If this issue has been corrected in the latest version, just tell me and I'll do an update.)

Thank you.
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

MenzAgitat,

Can you post your modified code using tinyurl for version v0.4? I'm using version 0.4 and the displayed url is too long.

Thanks!

:)
User avatar
MenzAgitat
Op
Posts: 118
Joined: Tue Jul 04, 2006 12:35 pm
Location: France
Contact:

Post by MenzAgitat »

 
@holycrap:
Be warned of a few things before modifying anything:
- This trick may not be clean but it is a trick, it had been made in 5mn and has not been intended to be made public.
- My modification uses an old version of TkTiny by Tomekk (v0.4 I think). Latest version is 0.5.
- It has only been tested on RSS Syndication v0.4 but you can probably adapt it to v0.5b1 without too much pain.
- I give it to you "as is" and I'm not providing support for it.
- It works for me.

If you agree with the preceding terms, let's go.

You must first add this proc in the script:

Code: Select all

proc grab_data { url } {
	set get_url_timeout "10"
	set uagent "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3"
	set url [string map -nocase {
		"&"		"&"
	} $url]
	set tiny_query "http://tinyurl.com/create.php?url=${url}"
	set tiny_token [http::config -useragent $uagent]
	set tiny_token [http::geturl $tiny_query -timeout [expr $get_url_timeout * 1000]]
	set html_data [http::data $tiny_token]
	set all_n [split $html_data \n]
	set tiny_link ""
	foreach tiny_lines $all_n {
		if {[regexp -all -nocase "name\=tinyurl" $tiny_lines]} {
			regsub -all -nocase "<input type=hidden name=tinyurl value=\"" $tiny_lines "" tiny_link
			regsub -all -nocase "\">" $tiny_link "" tiny_link
		}
	}
	if {$tiny_link != "0" && $tiny_link != ""} {
		return $tiny_link
	} {
		return "\00307(there's a problem with tinyurl.com)\003 \00314${url}\003"
	}
}
then find the line:

Code: Select all

set tmp [[namespace current]::xml_list_flatten $tmp]
and add just after it:

Code: Select all

 			if {([info exists feed(charset)]) && (([string last "title" $cookie] == 25) || ([string last "title" $cookie] == 19))} { set tmp [encoding convertfrom $feed(charset) [encoding convertfrom $feed(charset) $tmp]] }
		  if {([string last "link" $cookie] == 25) || ([string last "link" $cookie] == 19)} { set tmp [grab_data [lindex $tmp]] }
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

It doesn't work, I still get the long url. Do I have to download the tinyurl.tcl and load it separately? I'm using v0.4

:(
S
Straasha
Voice
Posts: 3
Joined: Wed Aug 27, 2008 3:27 am

Post by Straasha »

Hi,

This script working fine.

Can you tell me, how I could change color ?

thx in advance.
S
Straasha
Voice
Posts: 3
Joined: Wed Aug 27, 2008 3:27 am

Post by Straasha »

Straasha wrote:Hi,

This script working fine.

Can you tell me, how I could change color ?

thx in advance.
i have found the command tcl /003 and it's ok.
Now i have other problem : the option "trigger-type" 0:2 workinf fine but with notice (1:3) he don't works....

Can you help me please ?

Thx.
S
Straasha
Voice
Posts: 3
Joined: Wed Aug 27, 2008 3:27 am

Post by Straasha »

It's ok now:

I have change line to : putserv "NOTICE $nick :$line"
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

It's ok now:

I have change line to : putserv "NOTICE $nick :$line"
You got it to work with tinyUrl support?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Just a side note: It's quite clear why the author of this script chose to leave this part out.

Code: Select all

<form>
<!--
///// DON'T SCREEN-SCRAPE, PLEASE CONTACT US TO FIND OUT HOW TO USE OUR API
<input type=hidden name=tinyurl value="http://tinyurl.com/63qeuv">
-->
</form>

Code: Select all

proc tinyurl {url} {
   # tinyurl given, let's expand to original url
   if {[regexp -nocase {tinyurl.com/(.+?)$} $url - url]} {
     set token [http::geturl "http://tinyurl.com/$url" -timeout 3000]
     upvar #0 $token state
     foreach {name value} $state(meta) {
       if {[regexp -nocase ^location$ $name]} { return $value }
     }
   } else {
   # regular url given, let's tiny size it!
     set token [http::geturl "http://tinyurl.com/create.php?[http::formatQuery url $url]" -timeout 3000]
     upvar #0 $token state
     if {[regexp {<blockquote><b>http://(tinyurl.com/.+?)</b>} $state(body) - value]} { return $value }
   }
   # something went wrong return original url
   return $url
}
Something like that is much simpler. If it finds the location you get a tinyurl, if it can't you get your regular url. Simplicity at it's finest. Then maybe add that procedure and change something to look like this.

Code: Select all

set tmp [tinyurl [[namespace current]::xml_list_flatten $tmp]]
Assuming that is the portion that holds the url/link.....

PS. The tinyurl example above has dual functionality if you read the comments. It also assumes you have done the 'package require http' part to satisfy use of http commands.
<speechles> .tcl set test [tinyurl http://egghelp.org]
<bot> Tcl: tinyurl.com/ykmt7p
<speechles> .tcl set test [tinyurl tinyurl.com/ykmt7p]
<bot> Tcl: http://egghelp.org
<speechles> .tcl set test [tinyurl http://egghelp.org/search.php?text=this ... +everybody]
<bot> Tcl: tinyurl.com/5se88f
<speechles> .tcl set test [tinyurl tinyurl.com/5se88f]
<bot> Tcl: http://egghelp.org/search.php?text=this ... +everybody
Since it uses formatquery any url combination will work with this tinyurl approach.
Post Reply