Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

RSS Feed

Recommended Posts

  • Administrators

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

 

 

;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 WyldRyde #Script-Help, SwiftIRC #Technical, Abjects #Technical, #AtomReactor

;MindForge #Technical,#Hollywood,#USA,#Emule-USA,#AtomReactor

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  0) { echo -at There has been an error... >RSS1.0Sock Error04 $+ %RSS.Name 07 $+ $remove(%RSS.Title,&,",>) 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 ( isin %RSSvar) {

      set %RSS.Title $gettok($replace(%RSSvar,,$chr(7),,$chr(7)),2,7)

    }

    if ($left(%RSSvar,7) == ) {

      set %RSS.Title $remove(%RSSvar,,)

    }

    if (
Link to comment
Share on other sites



×
×
  • Create New...