RSSFeed Script

By FordLawnmower on Mar 25, 2009

Very simple script. It checks RSS pages based on the delay that you set and it returns the page changes to the channels you pick. I had this done for quite some time, but I didn't want to post it till I let it run for several weeks. I've had the core of it running in 15 channels for over a month with no problems. There are some instructions at the top of the script and I will make a screen shot of the lil' dialogs now. My screenshots are terrible, because the program I have always used, just stopped working. I have some crap trial thing. Sucks ;/
Image
Image

;RSS Feed Script by Ford_Lawnmower
;This is very easy to use. Just load it into remotes and check any menu for RSSFeed. Click the dialogs and start Adding Feeds.
;Initially it will show 4 and after that it will update with the delay you set. Max output is set to 4 lines.
;When adding or editing Feeds, You must fill in all the boxes. [Name] is the name you want posted before the link. It can also be a short phrase. 
;[Feed link] is a link to a valid RSS page. [Delay] is the number of seconds between page checks. Anything under 2 minutes will be ignored.
;[Chans] is a list of the Channels for this Feed to display to. The dialog states the format as separated by a space. You can also separate them
;with a comma. Not Both, either or.!! Known bugs, Dialogs are out of order, so it tabs down and then back up. 
;Questions, Comments: You can find me on irc.GeekShed.net #Script-Help
alias RSS1.0 {
  dialog -m RSSFeed1 RSSFeed1
}
dialog RSSFeed1 {
  title "RSS Feed 1.0"
  size -1 -1 104 136
  option dbu
  list 1, 8 16 90 82
  button "Add", 2, 8 104 29 12
  button "Delete", 3, 40 104 29 12
  button "Edit", 4, 72 104 29 12
  button "Close", 5, 8 120 93 12, ok cancel
  text "Click Add or Click a feed to Edit/Del ", 6, 8 8 89 8, center
}
dialog RSSFeed2 {
  title "RSS Feed 1.0 Add/Edit"
  size -1 -1 104 104
  option dbu
  edit "", 1, 8 16 42 10, autohs
  text "RSS Name", 2, 8 8 41 8, center
  edit "", 3, 8 40 90 10, autohs
  edit "", 4, 56 16 42 10, autohs
  text "Delay in Seconds", 5, 56 8 41 8, center
  text "RSS Feed Link - ie http://Rss.Bla", 6, 8 32 89 8, center
  edit "", 7, 8 64 90 10, autohs
  text "Chans for Feed Separate  w/Space", 8, 8 56 89 8
  button "Accept", 9, 8 80 37 12, ok
  button "Cancel", 10, 60 80 37 12, cancel
}
On *:dialog:RSSFeed1:init:*: {
  didtok RSSFeed1 1 32 %Global.Feed.List
}
On *:dialog:RSSFeed2:init:*: {
  did -a RSSFeed2 1 %Feed.Name
  did -a RSSFeed2 3 %Feed.Link
  did -a RSSFeed2 4 %Feed.Delay
  did -a RSSFeed2 7 %Feed.Chans
}
On *:dialog:RSSFeed1:Sclick:*: {
  if ($did == 2) {
    dialog -x RSSFeed1
    dialog -m RSSFeed2 RSSFeed2
  }
  if ($did == 3) {
    if ($did(1).sel) {
      .timerRSS [ $+ [ $gettok($hget(rssfeed,$did(1).seltext),1,32) ]  ] off
      hdel  RSSFeed $did(1).seltext
      did -d RSSFeed1 1 $did(1).sel
      set %Global.Feed.List $didtok(RSSFeed1,1,32)
      else { return }
    }
  }
  if ($did == 4) {
    if ($did(1).sel) {
      set %Feed.Name $did(1).seltext
      set %Feed.Link $gettok($hget(rssfeed,$did(1).seltext),1,32)
      set %Feed.Chans $gettok($hget(rssfeed,$did(1).seltext),2,32)
      set %Feed.Delay $gettok($hget(rssfeed,$did(1).seltext),3,32)
      dialog -x RSSFeed1
      dialog -m RSSFeed2 RSSFeed2
    }
    else { halt }
  }
}
On *:dialog:RSSFeed2:Sclick:*: {
  if ($did == 9) {
    if ($hget(rssfeed,%Feed.Name)) {
      .timerRSS [ $+ [ $gettok($hget(rssfeed,%Feed.Name),1,32) ]  ] off      
      hdel RSSFeed %Feed.Name
      set %Global.Feed.List $remove(%Global.Feed.List,$replace(%Feed.Name,$chr(32),-))
    }
    if (%Feed.Name.Temp) {
      if ($hget(rssfeed,$replace(%Feed.Name.Temp,$chr(32),-))) {
        .timerRSS [ $+ [ $gettok($hget(rssfeed,%Feed.Name.Temp),1,32) ]  ] off      
        hdel RSSFeed %Feed.Name.Temp
        set %Global.Feed.List $remove(%Global.Feed.List,$replace(%Feed.Name.Temp,$chr(32),-))
      }
      set %Feed.Name %Feed.Name.Temp
    }
    if (%Feed.Link.Temp) { set %Feed.Link %Feed.Link.Temp }
    if (%Feed.Delay.Temp) { set %Feed.Delay %Feed.Delay.Temp }
    if (%Feed.Chans.Temp) { set %Feed.Chans %Feed.Chans.Temp }
    if (!%Feed.Name) || (!%Feed.Link) || (!%Feed.Delay) || (!%Feed.Chans) { echo -a You must fill in all the boxes!!! | dialog RSSFeed2 | halt }
    unset *.Temp
    if (!$hget(RSSFeed)) { hmake RSSFeed 5 }
    hadd RSSFeed $replace(%Feed.Name,$chr(32),-) $remove(%Feed.Link,$chr(32)) $replace(%Feed.Chans,$chr(32),$chr(44)) $remove(%Feed.Delay,$chr(32))
    RSS.Feed $replace(%Feed.Name,$chr(32),-) $remove(%Feed.Link,$chr(32)) $replace(%Feed.Chans,$chr(32),$chr(44)) $remove(%Feed.Delay,$chr(32))
  set %Global.Feed.List %Global.Feed.List $replace(%Feed.Name,$chr(32),-) }
  unset %Feed.*
  dialog -m RSSFeed1 RSSFeed1
}
if ($did == 10) { unset *.Temp %Feed.* | dialog -m RSSFeed1 RSSFeed1 }
On *:dialog:RSSFeed2:edit:*: {
  if ($did == 1) { set %Feed.Name.Temp $did(RSSFeed2,1) }
  if ($did == 3) { set %Feed.Link.Temp $did(RSSFeed2,3) }
  if ($did == 4) { set %Feed.Delay.Temp $did(RSSFeed2,4) }
  if ($did == 7) { set %Feed.Chans.Temp $did(RSSFeed2,7) }
}
alias -l RSS.timeout {
  RSS.clear
}
alias -l RSS.clear {
  unset %RSS*
  sockclose RSS
  .timer-RSS off
  halt
}
On *:Text:!Rss.Status:#: {
  var %timer.num = $timer(0),%timer.timer = 1
  while (%timer.num) {
    if ($left($timer(%timer.num),3) == rss) { 
      .timer 1 %timer.timer .msg $chan 07 $timer(%timer.num) = 04 $timer(%timer.num).com 06Next Check in09 $timer(%timer.num).secs 07Seconds
    }
    inc %timer.timer
    dec %timer.num
  }
}
alias -l RSS.Status {
  var %timer.num = $timer(0)
  while (%timer.num) {
    if ($left($timer(%timer.num),3) == rss) { echo -at 07 $timer(%timer.num) = 04 $timer(%timer.num).com }
    dec %timer.num
  }
}
alias RSS.Feed {
  RSS $1 $2 $remove($3,$chr(32))
  if ($4) && ($4 >= 120) { .timerRSS $+ $2 -o 1 $4 RSS.Feed $1 $2 $3 $4 }
  if (!$4) || ($4 < 120) { .timerRSS $+ $2 -o 1 120 RSS.Feed $1 $2 $3 }
}
alias -l RSS {
  set %RSS.chans $3
  set %RSS.name $1
  sockclose RSS
  set %RSSsite $gettok($remove($2,http://),1,47)
  set %RSSurl $remove($2,http://,%RSSsite)
  if (!$hget(%RSSsite)) { hmake %RSSsite 10 }
  set %RSS.Count 1
  set %RSS.Max 4
  sockopen RSS %RSSsite 80
  .timer-RSS 1 20 RSS.timeout
}
on *:sockopen:RSS: {
  sockwrite -nt $sockname GET %RSSurl HTTP/1.0
  sockwrite -n $sockname User-Agent: Opera 9.6
  sockwrite -n $sockname Host: %RSSsite $+ $CRLF $+ $CRLF
}
on *:sockread:RSS: {
  if ($sockerr > 0) { echo -at There has been an error... >RSS1.0<>Sock Error< |  RSS.clear }
  else {
    var %RSSvar |  sockread %RSSvar
    if (<entry> isin %RSSvar) { set %RSS.Start on }
    if (</entry> isin %RSSvar) || (</item> isin %RSSvar) {
      set %RSS.Dup Off
      if ($hfind(%RSSsite,$right($remove(%RSS.title,$chr(32)),70))) { set %RSS.Dup ON }
      if (%RSS.Dup == Off) && (%RSS.Count <= %RSS.Max) { 
        set %RSS.Output 1
        while $gettok(%RSS.Chans,%RSS.Output,44) {
          if ($gettok(%RSS.Chans,%RSS.Output,44) ischan) { 
            .msg $gettok(%RSS.Chans,%RSS.Output,44) 04 $+ %RSS.Name 07 $+ $remove(%RSS.Title,&amp;,&quot;,&gt;) 06 $+ $replace($nospace(%RSS.Link),$chr(32),$chr(37) $+ 20)
          }
          inc %RSS.Output
        }
        inc %RSS.Count
        ;echo -a $replace(%RSS.Link,$chr(32),$chr(37) $+ 20) 
      }
      hadd %RSSsite $right($remove(%RSS.title,$chr(32)),70) %RSS.Link $+ $chr(7) $+ %RSS.Title $+ $chr(7) $+ %RSS.Date $+ $chr(7)
    }
    if (<title> isin %RSSvar) {
      set %RSS.Title $gettok($replace(%RSSvar,<title>,$chr(7),</title>,$chr(7)),2,7)
    }
    if ($left(%RSSvar,7) == <title>) {
      set %RSS.Title $remove(%RSSvar,<title>,</title>)
    }
    if (<link href=" isin %RSSvar) {
      set %RSS.Link $nospace($remove(%RSSvar,<link href="," />))
    }
    if (<link> isin %RSSvar) {
      set %RSS.Link $gettok($replace(%RSSvar,<link>,$chr(7),</link>,$chr(7)),2,7)
    }
    if ($left(%RSSvar,6) == <link>) {
      set %RSS.Link $remove(%RSSvar,<link>,</link>)
    }
    if  (<updated> isin %RSSvar) {
      set %RSS.Date $gettok($replace(%RSSvar,<updated>,$chr(7),</updated>,$chr(7)),2,7)
    }
    if ($left(%RSSvar,9) == <updated>) {
      set %RSS.Date $remove(%RSSvar,<updated>,</updated>)
    }
    if (<pubdate> isin %RSSvar) {
      set %RSS.Date $gettok($replace(%RSSvar,<pubdate>,$chr(7),</pubdate>,$chr(7)),2,7)
    }
    if ($left(%RSSvar,9) == <pubdate>) {
      set %RSS.Date $remove(%RSSvar,<pubdate>,</pubdate>)
    }
    if (</feed> isin %RSSvar) || (</rss> isin %RSSvar) || (</channel> isin %RSSvar) { RSS.Clear }
  }
}
alias -l RSS.StartUp {
  var %num = $hget(rssfeed,0).item, %delay = 5
  while (%num) {
    .timer 1 %delay RSS.Feed $hget(rssfeed,%num).item $gettok($hget(rssfeed,%num).data,1,32) $gettok($hget(rssfeed,%num).data,2,32) $gettok($hget(rssfeed,%num).data,3,32)
    inc %delay 7
    dec %num
  }
}
alias -l flink {
  var %find.link = $1-,%found.link
  while ($left(%find.link,4) != http) && ($len(%find.link) > 8) {
    %found.link = $right(%find.link,$calc($len(%find.link) - 1))
  }
  return %found.link
}
alias -l nospace {
  var %space.check = $1-
  while ($left(%space.check,1) == $chr(32)) { %space.check = $right(%space.check,$calc($len(%space.check) - 1)) }
  while ($right(%space.check,1) == $chr(32)) { %space.check = $left(%space.check,$calc($len(%space.check) -1)) }
  return $replace(%space.check,&amp;,&)
}
alias -l httpstrip {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}
On *:Connect: {
  if (!$hget(RSSFeed)) { hmake RSSFeed 5 }
  RSS.StartUp
}
On *:Start: {
  if (!$hget(RSSFeed)) { hmake RSSFeed 5 }
  if ($isfile(RSSFeed.hsh)) { hload -s RSSFeed RSSFeed.hsh }
}
On *:Exit: {
  if ($hget(RSSFeed)) { hsave RSSFeed RSSFeed.hsh }
  hfree RSSFeed
}
On *:Disconnect: {
  if ($hget(RSSFeed)) { hsave RSSFeed RSSFeed.hsh }
}
On *:Unload: {
  hfree RSSFeed
}
menu * {
  -
  .RSSFeed1.0
  ..Dialogs:RSS1.0
  ..List Feeds:RSS.Status
  -  
}

Comments

Sign in to comment.
dma   -  Dec 19, 2015

ok i outin the rss feed links and nothing happens they go to my notices window what do I do? dma

 Respond  
cptpan   -  Oct 08, 2013

How can I stop the script from incorrectly converting symbols?

ie. That's

dronez4  -  Oct 09, 2013

if ('s isin $1-) { halt }

FordLawnmower  -  Oct 09, 2013

@cptpan This script is no longer supported. Please use this one instead : http://www.hawkee.com/snippet/6339/

cptpan  -  Oct 11, 2013

But I want it for rss and xml feeds, not twitter.

Sign in to comment

cptpan   -  Oct 05, 2013

Why do some rss titles look like this:

<![CDATA[Title here]]>

 Respond  
cptpan   -  Feb 21, 2013

Why do you add such terrible colours? It takes me a while to work out how to edit them all out..

FordLawnmower  -  Feb 21, 2013

All of my scripts have the same theme cptpan. I make them for myself and spend more time making them configurable so someone like you can personalize them, then it takes me to write the script it's self.
I'm so sorry to waste all of your time changing the colors on my scripts ;/
Edit: I just noticed that this is a very old script and it's no longer supported. I don't like the colors on this either, but I made it years ago and it would be easier to rewrite than edit at this point since it doesn't really work anymore.
This script is still being updated:: http://www.hawkee.com/snippet/6339/

cptpan  -  Feb 23, 2013

I've slowly worked out how to edit the colours out.

Anyway, this didn't work for me. I'm having a lot of trouble finding a RSS feed script that can read ATOM feeds.

Any ideas where to look, or one that works?

Sign in to comment

MashhitDK   -  Oct 24, 2011

Big thanks... +Like

 Respond  
Pangaea   -  Oct 11, 2011

/me pan is all ears

 Respond  
Xavia   -  Oct 11, 2011

I have some update the the snippet, if yuu wont to hear?

8/10

  • Like
 Respond  
Pangaea   -  Oct 08, 2011

yup.. the other one works like a dream
great job again on yet another fine script.. keep`em comming

 Respond  
FordLawnmower   -  Oct 08, 2011

@Pangaea this script is no longer maintained or updated.
This script will do the same thing and is easier to use: http://www.hawkee.com/snippet/6339/

 Respond  
Pangaea   -  Oct 08, 2011

when i do the list feeds option (right click menu) i get this
rsshttp://www.sciencedaily.com/rss/matter_energy/physics.xml = RSS.Feed Physics-News http://www.sciencedaily.com/rss/matter_energy/physics.xml #PhysicsTrivia
yet its not doing anything in chan
ive set the seconds for 10, 20, 60, 120, 200
nothing
ive tried with about 10 other rss links... still nothing

 Respond  
Pangaea   -  Oct 08, 2011

how on earth are you guys getting this to work?
i just dont understand why others are having success with this every time and im struggling to get ANY rss feed script even working. I just dont get it
i am trying this as a test
http://www.sciencedaily.com/rss/matter_energy/physics.xml

but the script is just sitting there doing nothing.. even with a time set to every 20 seconds
gah.. ive NEVER got an rss feed to work properly in all my years of irc.. i just cant belive it

 Respond  
Stewie1k94   -  Oct 05, 2011

Very useful

 Respond  
FordLawnmower   -  Sep 10, 2011

This script is no longer maintained and I have no plans to update it:
This script can handle many more types of feeds: http://www.hawkee.com/snippet/6339/

 Respond  
Jordyk19   -  Sep 10, 2011

Very nice, this is what i searched!

 Respond  
Jeroi   -  Sep 10, 2011

Hello.

I suggest a feature addition of adding separate winow for list feeds. Also option to send some news link to some channel which even is not descriped as a news channel.

 Respond  
Sonic7   -  Jul 03, 2011

Hello i get this problem:
【01:36:48】 6[Nyaa] 4[Zero-Raws] Sacred Seven - 01 (MBS 1280x720 x264 AAC).mp4 15http://www.nyaa.eu/?page=download&tid=225456
【01:36:49】 6[Nyaa] 4[Zero-Raws] Nurarihyon no Mago Sennen Makyou - 01 (MX 1280x720 x264 AAC).mp4 15http://www.nyaa.eu/?page=download&tid=225455

the ( that should be "(" and ) that should be ")" how do i fix it?

 Respond  
Cold_Fussion   -  Nov 27, 2010

Thanks man...... Works 100%

10/10

 Respond  
RicJames   -  Jun 25, 2010

Just a couple of suggestions FLM would be possible to have triggers to trigger the last feed from the rss site? Or the ability to set an rss feed to output to the channel more than once? Also how do I change the default feed colour?

Thanks In Advance :)

Edit: Also I have problem with this and the twitterfeed snippet, sometimes when I open the dialogue to edit the settings it will freeze my irc client forcing me to close it.

 Respond  
RicJames   -  Jun 24, 2010

Lol damn why did I only find this now? I've been looking for an rss snippet for a while I even searched the site with no luck, I've been using twitfeed and it's been awesome but now I think I'm gonna migrate all my rss feeds to this.

Thanks for another awesome scripts FLM 10/10 from me :)

 Respond  
DanB   -  Jun 24, 2010

What would have to be changed/added to make it so that you could search through the stored rss feed, ie have a !search command?

I'd like to be able to use this to display the news from a friends site, but also be able to search its archived portions.

 Respond  
FordLawnmower   -  May 13, 2010

@RyanSeavert Try this rss feed script -->> http://www.hawkee.com/snippet/6339/
It's more advanced and should handle that feed style.

 Respond  
RyanSeavert   -  May 10, 2010

I have your script loaded through a bot. When is displays the feed, the data is not coming up correct. Below is an example.

Hausen-eSports-News <![CDATA[Hausen eSports' CS:S Team Is On a Roll.]]> <![CDATA[%20http://teamhausen.com/pt/Yes-hausen-gets-selected-to-Lanchamp/blog.htm%20]]>

Any suggestions?

 Respond  
XiVol   -  Mar 27, 2010

Actually, doesn't matter any more I'm using the TwitFeed now and it's more than what I needed!

 Respond  
XiVol   -  Mar 27, 2010

Hmmm, it seems that I have a problem - I'm using it with an RSS feed from an SMF forum but it only seems to announce when it feels like it, for instance it'll post a new topic but the next topic it won't announce it to the chat at all. :( Any reason for this? Nothing is changed except for the name,chan,time etc.

 Respond  
FordLawnmower   -  Feb 21, 2010

Yea, the twitfeed script supports almost every type of feed.

 Respond  
Askeen   -  Feb 21, 2010

i changed the name of the site to "thesite"

och does it work on other feeds tho? that twitfeed?

 Respond  
FordLawnmower   -  Feb 20, 2010

Askeen Those pages don't exist.
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Try checking the feed with your browser before you put it in the script.
If you are just getting started with this, I would suggest using this script -->> http://www.hawkee.com/snippet/6339/ <<-- It has support for more different styles of rss pages and it has been updated recently.
I'll try to update this one soon, but for now I would use the other script.

 Respond  
Askeen   -  Feb 20, 2010

why does not these work?

http://www.thesite.com/rss.xml

http://www.thesite.com/rss.php?type=0

Edit1:

none of the commands works.

!rss dosent work
!rss.status dosent work
!rss.feed dosent work.

Edit2: in the server windows i got this

  • /sockwrite: 'RSS' not connected (line 154, rssfeed.mrc)
 Respond  
FordLawnmower   -  May 28, 2009

Thank You err0r007 :)

 Respond  
err0r007   -  May 28, 2009

good job FL

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.