Difference between revisions of "Ircbot"

From Fixme.ch
Jump to: navigation, search
(Configuration and Installation)
(Configuration and Installation)
Line 15: Line 15:
 
  su -c 'willie -w' irc-bot
 
  su -c 'willie -w' irc-bot
 
* Patch rss to show the link of the article
 
* Patch rss to show the link of the article
 +
<pre>
 +
--- /tmp/willie/willie/modules/rss.py  2013-07-20 17:43:43.570496043 +0200
 +
+++ /usr/local/lib/python2.7/dist-packages/willie/modules/rss.py        2013-07-20 17:54:07.144679013 +0200
 +
@@ -348,8 +348,8 @@
 +
                continue
 +
 +
        # print new entry
 +
-        message = u"[\x02{0}\x02] \x02{1}\x02 {2}".format(
 +
-            colour_text(feed_name, fg, bg), entry.title, entry.link)
 +
+        message = u"[\x02{0}\x02] \x02{1}\x02 {2} {3}".format(
 +
+            colour_text(feed_name, fg, bg, article_url), entry.title, entry.link)
 +
        if entry.updated:
 +
            message += " - " + entry.updated
 +
        bot.msg(feed_channel, message)
 +
</pre>
  
 
== Plugins ==
 
== Plugins ==

Revision as of 16:56, 20 July 2013

Information

Configuration and Installation

  • /home/irc-bot/.willie/default.cfg
  • Installation (latest version with better rss module)
cd /tmp; git clone git://github.com/embolalia/willie.git
cd willie; python setup.py install; rm -fr /tmp/willie
pip install feedparser pytz lxml pygeoip praw
apt-get install python-enchant
su -c 'willie -w' irc-bot
  • Patch rss to show the link of the article
--- /tmp/willie/willie/modules/rss.py   2013-07-20 17:43:43.570496043 +0200
+++ /usr/local/lib/python2.7/dist-packages/willie/modules/rss.py        2013-07-20 17:54:07.144679013 +0200
@@ -348,8 +348,8 @@
                 continue
 
         # print new entry
-        message = u"[\x02{0}\x02] \x02{1}\x02 {2}".format(
-            colour_text(feed_name, fg, bg), entry.title, entry.link)
+        message = u"[\x02{0}\x02] \x02{1}\x02 {2} {3}".format(
+            colour_text(feed_name, fg, bg, article_url), entry.title, entry.link)
         if entry.updated:
             message += " - " + entry.updated
         bot.msg(feed_channel, message)

Plugins

RSS

.rss add #channel name http://example.com/rss
.rss del name
.rss list
.startrss