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
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: Decompressing using built-in zlib tcl > 8.6

Post by speechles »

nik-k wrote:Does anybody know, how to use built-in zlib for decompressing feeds?
Indeed. With tcl8.6b2 and higher, http Package handles gzip internally. It also doesn't alter the content-encoding after it has decompressed the data. So rss-synd attempts to decompress it again, and obviously this fails. To fix it, remove the decompression routine from rss-synd. Alter the procedure found removing almost everything it does, then it will work.. Here is how the procedure should look after you alter it.

Code: Select all

# decompress gzip formatted data
proc ::rss-synd::feed_gzip {cdata} {
   return $cdata
}
Notice it does nothing now, simply returns the value the procedure was given. This is how tcl8.6's gzip requires it to be.
n
nik-k
Voice
Posts: 2
Joined: Wed Dec 17, 2008 3:11 pm

Well done

Post by nik-k »

Thanks a lot, speechless.

I have not expected that it is so easy :D
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

Here goes some fun for you!

RSS Feed: http://www.reddit.com/r/aww/new/.rss

current "output":

Code: Select all

\\\[\002/r/\[reddittwo @@item!link@@\]\002\\\] @@item!title@@ - @@item!url@@@@entry!link!=href@@"
Output in IRC:
[/r/aww] Post Title - http://www.reddit.com/r/aww/comments/ur ... tc_etc_etc


What I am looking to have, instead of the comments URL, I'd like to be able to have the submitted URL (in these cases, typically the imgur album link). Is there a method to be able to do that?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

neocharles wrote:Here goes some fun for you!

...snipped a few parts with code and such...

What I am looking to have, instead of the comments URL, I'd like to be able to have the submitted URL (in these cases, typically the imgur album link). Is there a method to be able to do that?

Code: Select all

"output"    "\\\[\002/r/\[reddittwo @@item!link@@\]\002\\\] @@item!title@@ - \[lindex \[regexp -inline \{(http://i.imgur.*?(?:jpg|png|gif|bmp))\} "@@item!description@@"\] 0\]"
"evaluate-tcl"      1
That was fun. :lol:
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

speechles wrote:
neocharles wrote:Here goes some fun for you!

...snipped a few parts with code and such...

What I am looking to have, instead of the comments URL, I'd like to be able to have the submitted URL (in these cases, typically the imgur album link). Is there a method to be able to do that?

Code: Select all

"output"    "\\\[\002/r/\[reddittwo @@item!link@@\]\002\\\] @@item!title@@ - \[lindex \[regexp -inline \{(http://i.imgur.*?(?:jpg|png|gif|bmp))\} "@@item!description@@"\] 0\]"
"evaluate-tcl"      1
That was fun. :lol:

Thanks! I hate regex by the way. How will this work if the link submitted is an album? Usually that is http://imgur.com/a/letters_and_numbers

<edit>

Did you happen to test this? It seems to still have only output the title...
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

neocharles wrote:Did you happen to test this? It seems to still have only output the title...
Just an update, seeing as this thread leaves off as if I didn't solve the fellows problem...
Segments of a chat from iRC wrote:<neocharles> speechles, what if someone has www.imgur.com/lettersandnumbers for the url in the rss feed?
<neocharles> instead of http://imgur.com or http://i.imgur.com
<neocharles> haha
<speechles> it will still show up neocharles
<neocharles> it didnt?
<speechles> http://imgur*
<speechles> oh the www
<neocharles> http://www.imgur
<speechles> i can add that
<neocharles> yeah
<neocharles> if you do that, that'll be a solid output.
<neocharles> I don't think imgur has links any other method.
<speechles> so neocharles, is it works proper now? :P
<neocharles> Yeah. Unless you know a way to not execute it at all if it's not an imgur link lmao
<neocharles> but that I'm not too concerned with tbh
<speechles> it wont capture anything then
<neocharles> bc I think that's outside the scope of what this script is supposed to do
<speechles> it will just have empty
<speechles> isnt that what you wanted?
<neocharles> I mean not even sending the title at all either haha
<neocharles> OR ....
<neocharles> maybe if it isn't one of those three.... send the reddit comment link lol
<speechles> that would be tricky tricky
<neocharles> haha
<speechles> you would have to nest [if] in there
<speechles> its doable though
<neocharles> if it will take you more than like 2 seconds, don't worry abou tit
<neocharles> about it
<speechles> so if, no urls, give that one?
<neocharles> if not imgur, give that instead.
<neocharles> so like, the /r/fiftyfifty subreddit people post from all different places
<speechles> "\\\[\002/r/\[reddittwo @@item!link@@\]\002\\\] @@item!title@@ - \[if \{\[string length \[set a \[lindex \[split \[lindex \[regexp -inline {(http://(?:i.imgur|imgur|www.imgur).*?$)} "@@item!description@@"\] 0\] \\"\] 0\]\]\]\} \{set a\} else \{set a \[reddit @@item!link@@\]\}\]"
<neocharles> you need to make a website or something for donations lol
<speechles> donate to thommey, or simple, or pixelz
<speechles> eggdrop itself
<speechles> i dont need the $$$
<speechles> or egghelp forums
<speechles> keeping those alive is the priority rather than feeding me
<speechles> i feed myself rather well :)
So neocharles, if you read this... for legacy purposes I don't want it to appear your problem was never solved. It gives the impression I just left you hanging which is far from the truth. :)

Code: Select all

"output"	"\\\[\002/r/\[reddittwo @@item!link@@\]\002\\\]  @@item!title@@ - \[if \{\[string length \[set a \[lindex \[split \[lindex \[regexp -inline {(http://(?:i.imgur|imgur|www.imgur).*?$)} "@@item!description@@"\] 0\] \\"\] 0\]\]\]\} \{set a\} else \{set a \[reddit @@item!link@@\]\}\]"
"evaluate-tcl"	1
r
rogerw
Voice
Posts: 3
Joined: Fri Nov 30, 2012 12:35 am

Post by rogerw »

Hi speechless...

Since you seem to be the go to guy for Andrew Scott's rss-synd et al, I was wondering if you can help me with this problem...

Each time the script tries to get a feed it produces this error:
Tcl error [::rss-synd::feed_get]: can't read "feed(updated)": no such element in array
When I do it manually, as in "!rss", it produces this error:
Tcl error [::rss-synd::trigger]: can't read "feed(trigger-type)": no such element in array
I've downloaded fresh copies of the scripts from (https://github.com/hm2k/rss-synd), both rss-synd.tcl and rss-synd-settings.tcl added the links, uploaded the scripts then rehashed the bot and that has done nothing to stop the error. I used only two rss links to test it. Finally, I killed the bot and restarted it, just to be sure.

I've checked the eggdrop.conf to make sure the scripts were in their proper sequence when loading (after egghttp.tcl). And they were good. Every other script that requires http is working properly.

If you like I can post the scripts.

Thanks for your help.

RW
Roger
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

rogerw wrote:Thanks for your help.
================================================================================
INSTALL
================================================================================

1. Copy rss-synd.tcl and rss-synd-settings.tcl to your scripts directory.
2. Add "source scripts/rss-synd.tcl" to your eggdrop.conf file.
Are you doing it this way? You aren't sourcing both rss-synd and it's settings are you?!
r
rogerw
Voice
Posts: 3
Joined: Fri Nov 30, 2012 12:35 am

Post by rogerw »

I checked that, and it's as it should be as per the instructions. I think I might have found the problem.

For some reason there were two instances of rss-synd-settings.tcl (yes, same file name for both) uploaded to the shell. One is the generic version and the other is the one I added my RSS links to.

I removed the generic and immediately the bot started posting this to the channel:
[$cookie_val(1)] $cookie_val(3) - $cookie_val(5)
I rehashed the bot and it seems to be working fine now as it posts the RSS feeds to the channel.

Weird.

Anyway, thanks for your help.
Roger
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

With tcl 8.6, it appears that the script is not working at all. I found this online:
https://github.com/hm2k/rss-synd/issues/9

I see that there is a different version of tcl available http://sourceforge.net/projects/tcl/files/Tcl/8.6b3/ but I am unsure if I should install that one, or if there is a patch for rss-synd...

Code: Select all

RSS Error: Unable to decompress "http://url.to.rss.feed/": Trf package not found.
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

Too long to edit that post...

Followed the steps here http://forum.egghelp.org/viewtopic.php? ... &start=353

and updated the output for reddit to

Code: Select all

"output"   "\\\[\002/r/\[lindex \[split @@item!link@@ /\] 4\]\002\\\]  @@item!title@@ - \[if \{\[string length \[set a \[lindex \[split \[lindex \[regexp -inline {(http://(?:i.imgur|imgur|www.imgur).*?$)} \"@@item!description@@\"\] 0\] \\\"\] 0\]\]\]\} \{set a\} else \{set a \[reddit @@item!link@@\]\}\]"
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

Is it possible to have multiple triggers?

eg: Instead of just !engadget, you could have !engadget and !technews both pull from the same db file?
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

Is there a limit to the number of feeds it can work through? I have added a few that just don't seem to update anymore...
User avatar
spithash
Master
Posts: 248
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

I get some irritating weird characters when a word has ' (for example the word victim's)
victimâ@Ys
EDIT: My bot is utf8 patched
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
u
user18765
Voice
Posts: 9
Joined: Sun Apr 15, 2012 6:14 am

RSS-Synd Plugin - Request for Improvement

Post by user18765 »

Hi. I'd like to tell you about some features that I'd like to have on the program, and also report a little problem that's driving me mad. It Happens whenever I enable gzip compression.

eggdrop vers. ===> 1.6.21 (installed from AUR)
TCL version ===> 8.5.13 (installed from AUR)
tcl-TRF vers. ===> tcltrf 2.1.4 (installed from AUR)

PROBLEM:

Code: Select all

[03:02:01] RSS HTTP Error: http://etc.etc.etc.feedlink.rss (State: {invalid command name "zlib"} {invalid command name "zlib"
    while executing
"zlib inflate [string range $data $pos end-8]"
    (procedure "Gunzip" line 42)
    invoked from within
"Gunzip $state(body)"} NONE)
I think this actually means there's no zlib in my system (arch-linux).
BUT that's NOT the case. I actually have zlib installed - from repositories. Then I thought that, perhaps, the TCL-zlib could be another different thing than the 'zlib' itself. So I tried to install 'tcllib', that contains a zlib library, but nothing changed, no success.
Then I thought: «well that's strange, I also have TCL-TRF that is actually working great and being used by other scripts, and...usually it is used as an alternative to zlib for compression tasks, so: why isn't the program trying to use it instead of stopping with zlib errors?»

I ended up talking with an expert TCL guy... he told me that he couldn't help me much without having access to a more detailed log, and, considering that eggdrop is well-known for its log-suppression policies, I should have ran the script from the shell to get such information. Thing that I cannot to do, because I would need to emulate an eggdrop request to the script, knowing almost nothing about tcl.

ADD: I found out that the package "zlib" is not present in tcl versions < 8.6
This means that there are 2 possible solutions: install tcl8.6 which has zlib integrated, or separately compile and install zlib. I tried both. 1)With tcl8.6 I had a NEW error about "Invalid Block Lenght" or something like that. 2)Separately compiling and installing zlib keeping my actual tcl version gives a NEW error, too. Here it is:

Code: Select all

RSS HTTP Error: http://feeds.etcetcetcetc (State: {invalid data: checksum mismatch -1794500591 != 3910586362} {invalid data: checksum mismatch -1794500591 != 3910586362
    while executing
"Gunzip $state(body)"} NONE)
So.. my help request is all about these last things: XOR how to get a more detailed log, XOR how to fix the problem if you already know how.

Then we come to the proposals: :D :D
________________________________________________________________

1 - It would be nice to group some feeds with a 2nd trigger (or why not, Nth trigger).
I try to explain why: When a guy comes to the channel and wants to know the news from MORE than one source, it would be nice if a "father-trigger" such as !news could call every feed that is in a preselected group. Instead of the user individually calling every feed with its own trigger.

2 - I like to keep my channel clean. For this reason I set the "announce-output" option to '1'. That works great for the feeds that are updated often and with individual entries. But that's not the case for MANY feeds, which, for example, get updated at a precise time of the day, with a whole bunch of entries (20~ on average): in these cases, my channel loses the 90% of the feeds on the automatic-output. What I am trying to propose is a new feature to regulate the whole output the way OWNER wants. This means adding 2 options (the 2nd consequent to the other - has no meaning without the 1st being enabled): the first is **avoid leaving anything not posted automatically** : The second is **Choose the time-interval you want to leave between every single auto-posting for the feeds that haven't been posted yet**. I hope my point is clear enough.

If you managed to read until this point, I must absolutely thank you for your attention :D
I wish all you guys a happy new year!

Byee ;)
Post Reply