~ubuntu-branches/ubuntu/precise/gozerbot/precise

« back to all changes in this revision

Viewing changes to doc/RSS

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Malcolm
  • Date: 2008-06-02 19:26:39 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080602192639-3rn65nx4q1sgd6sy
Tags: 0.8.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
===
2
 
RSS
3
 
===
4
 
 
5
 
__copyright__ = 'this file is in the public domain'
6
 
 
7
 
first check if you have RSS permission
8
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9
 
::
10
 
 
11
 
    <dunk> !perms
12
 
    <gozerbot> you have permissions = USER .. OPER
13
 
 
14
 
if this is not the case add it
15
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16
 
::
17
 
 
18
 
    <dunk> !setperms dunk rss
19
 
    <gozerbot> ok
20
 
 
21
 
see which rss commands the bot has with
22
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23
 
::
24
 
 
25
 
    <dunk> !apro rss
26
 
    <gozerbot> 1) rss-url 2) rss-setsleeptime 3) rss-del 4) rss-add 5)
27
 
               rss-delchannel 6) rss-delitemslist 7) rss-stopwatch 8)
28
 
               rss-addchannel 9) rss-sleeptime 10) rss-list 11) rss-itemslist 12)
29
 
               rss-scan 13) rss-watch 14) rss-running 15) rss-get 16)
30
 
               rss-additemslist
31
 
 
32
 
you will want to add a url to the RSS system, we use slashdot as an example
33
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34
 
::
35
 
 
36
 
    <dunk> !rss-add slash http://rss.slashdot.org/Slashdot/slashdot
37
 
    <gozerbot> ok
38
 
 
39
 
see if the url works
40
 
~~~~~~~~~~~~~~~~~~~~
41
 
::
42
 
 
43
 
    <dunk> !rss-get slash
44
 
    <gozerbot> 1) TV Piracy is Next 2) Smarter Phones Coming Soon 3) 7
45
 
               Megapixel Camera Phone 4) Jon Bringing WMV9 to Linux 5) Wireless
46
 
               Mouse with no Batteries 6) Blog Torrent Beta Released 7) Titanic
47
 
               Director to Make Battle Angel Movie 8) Malware: Fighting Malicious
48
 
               Code 9) Best Tools for Machinima? 10) Nmap Author Receives FBI
49
 
               Subpoenas
50
 
 
51
 
to let the bot check for updates
52
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53
 
::
54
 
 
55
 
    <dunk> !rss-watch slash
56
 
    <gozerbot> watcher thread started
57
 
 
58
 
see if the thread is running
59
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60
 
::
61
 
 
62
 
    <dunk> !rss-running
63
 
    <gozerbot> 1) slash ['#dunkbots']
64
 
 
65
 
if you want to stop watching
66
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67
 
::
68
 
 
69
 
    <dunk> !rss-stopwatch slash
70
 
    <gozerbot> ok
71
 
 
72
 
see what other data the rss feed has to offer
73
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
 
::
75
 
 
76
 
    <dunk> !rss-scan slash
77
 
    <gozerbot> story = 20 author = 20 link = 20 section = 20 title = 20
78
 
               comments = 20 topic = 20 time = 20 department = 20 image = 20
79
 
               backslash = 1
80
 
 
81
 
this counts the number of times a certain tag is found in the feed.
82
 
 
83
 
so if we also want for example the link field added
84
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
 
you can add that item to the itemslist::
86
 
 
87
 
    <dunk> !rss-additemslist slash link
88
 
    <gozerbot> ok
89
 
 
90
 
check::
91
 
 
92
 
    <dunk> !rss-get slash
93
 
    <gozerbot> 1) Cracking the Google Code... Under the GoogleScope -
94
 
               http://slashdot.org/article.pl?sid=05/05/10/1546207 2) Broadway
95
 
               Awards Spam - http://slashdot.org/article.pl?sid=05/05/10/1455206 3)
96
 
               More on Last Years Cisco Source Code Theft -
97
 
               http://slashdot.org/article.pl?sid=05/05/10/1339234 4) What Does a
98
 
               Spreading Worm Look Like? -
99
 
               http://slashdot.org/article.pl?sid=05/05/10/1333202  (+2)
100
 
 
101
 
to remove use rss-delitemslist.
102
 
 
103
 
poll time
104
 
~~~~~~~~~
105
 
 
106
 
the bot will default poll once every 30 min. if you want the bot to poll
107
 
every x seconds you can use the rss-setsleeptime command (min is 60 seconds).