[MOD] AutoRSS

Back to Module Support

Page: 1  
From User Message Body
hery
Post #824
Member
Date: 6:38 am, Sep 28 2008
Posts: 15


AutoRSS by hery

When you use !autorss the first time, then you become the admin. Admin can add or delete links, other admins and settings.

You have to set up the channel (default is #serasera but I'm sure your bot is not on it)

To set up a channel

Code
!autorss set channel #your_channel


To set up the interval (must be bigger than 300)

Code
!autorss set timer 600


To add a link

Code
!autorss link add http://....rss


To add an admin

Code
!autorss admin add john


Click here for the module information page.

This is a support thread. You can ask questions about this mod, or request feature changes as you wish.

Touchpad
Post #903
Member
Date: 3:02 am, Jan 14 2009
Posts: 1


I love this module, 1 thing though I'd love to change one thing;

lets call it "new"

a function that checks if anything new has been posted on the rss and if so then it posts it on irc instead of having it like it is now (spamming every 300 (default) ms into the chan) shouldn't be to hard to change I'll have a look at it soon and get back to you about it if you've not done anything about it before me

thx ALOT for this one though =)

Roots
Post #978
Member
Date: 5:42 am, Jun 1 2009
Posts: 1


For some reason its not working for me, I uploaded the autorss folder and then I went to the function.conf page and added the include.

I went to the channel the bot is in and type in all those command and the bot in DCC says

<PHPBot> --> Sending !AUTORSS SET CHANNEL #TEST to USER
<PHPBot> --> Sending !AUTORSS SET TIMER 300 to USER
<PHPBot> --> Sending !AUTORSS LINK ADD URLHERE

and ya I don't see myself added in the autorss.ini and i didn't see a feed post in the channel yet.

Any ideas?

MuNgLo
Post #1031 - Reply to (#978) by Roots
Member
Date: 3:32 pm, Apr 12 2010
Posts: 22


Well Roots, I just had the same problem. Took me a while but eventually I found that I had an ! at the end of the nick in bot.conf that was stripped by Quakenet. Thus the bot ended up without the ! in the nick.
When I changed the nick in bot.conf without the ! on the end it all cmd's started working.
\o/

Worth a try.

MuNgLo
Post #1032
Member
Date: 10:44 pm, Apr 15 2010
Posts: 22


Just an ugly hack i did of the autorss.php file to get the bot to say latest news only from feed and only once.
Im getting hang on the ini cmd's so a rewrite might happen. This is not nice at all :P

All changes is from row 304 and on
Code

// <--- Row 304 -- CUSTOM MuNgLo                
                $feed = new SimplePie();
                $feed->enable_cache(false);
                $feed->set_cache_location($this->cachedir);
                $feed->set_feed_url($link);
                $feed->init();
                $items = $feed->get_items(0, 1);
                $contenttitle = $feed->get_title();
                foreach ($items as $item)
                {


    $filename = $feed->get_title();  // replace feednames so it can be used as filename
    if($feed->get_title() == "Nyheter från FZ.se (PC/Mac)"){$filename = "FZ.se";}
    if($feed->get_title() == "Twitter / R60org"){$filename = "R60.org-Twitter";}
    if($feed->get_title() == "CAREMODE"){$filename = "caremode";}
$cachefulldir = "D:/PHP-bot/bazinga/modules/autorss/cache/".$filename.".txt";
                if(!$item->get_title()=="")
                {
                    // Check for and/or create/read backupfile
                        if (file_exists($cachefulldir))
                        {$lastnews = fopen($cachefulldir, "r+b");
                        } else {
                        $lastnews = fopen($cachefulldir, "w+b");
                        }

                        if(filesize($cachefulldir)>0){$cachecontent=fread($lastnews, filesize($cachefulldir));}
                        fclose($lastnews);
                    $feedcontent = $item->get_title();
                    if($feedcontent<>$cachecontent)
                        {    

                        // tell channel feed title
                            $this->ircClass->privMsg($chan, BOLD . $contenttitle);
                        // tell channel item title
                            $a=$item->get_description();
                            if($feedcontent<>$a){$this->ircClass->privMsg($chan, $feedcontent);}
                        // cull item description
                            $desc = substr(strip_tags(html_entity_decode($item->get_description())), 0, 150);
                            $desc = ereg_replace("\n", " ", $desc);
                            $desc = ereg_replace("\r", " ", $desc);
                        // add item date on description
                            $this->ircClass->privMsg($chan,  $desc . "... (" . $item->get_date('d/m/Y') . ")");
                            // tell link to item
                            $this->ircClass->privMsg($chan, $item->get_link());
                        // Delete old cachefile and write new
                            unlink($cachefulldir);
                            $lastnews = fopen($cachefulldir, "w+b");
                            fwrite($lastnews, $feedcontent);
                            fclose($lastnews);
                        }
                    /* //Bit of checkcode. Uncomment if you want. Tells DCC chat if rss feed was judged old
                        else{$this->dccClass->dccInform("AUTORSS New/Old Checker : ". BOLD ."OLD". BOLD ." : ".$contenttitle." - ".$item->get_title());
                        // tell channel item title
                            $this->dccClass->dccInform("Feed -> ".$feedcontent);
                        // tell cache item title
                            $this->dccClass->dccInform("Cache-> ".$cachecontent);
                            }
                    */
                }
                
                
                }
            }
        }
        return true;
    }
    
}

?>


   

Back to Module Support