wordcloudbot

systemd service that listens to fedmsg for IRC meeting logs, generates a word cloud, and tweets it to a Twitter account  |  https://twitter.com/fedobot

Commit 368d29f Cleaned up a bit more

1 file Authored and Committed by decause 2 years ago
Cleaned up a bit more

    
README.rst +65 -147
  1 @@ -2,9 +2,7 @@
  2   ============
  3   
  4   
  5 - How
  6 - ===
  7 - it's going to work
  8 + How it's going to work
  9   ~~~~~~~~~~~~~~~~~~
 10   
 11   .. image:: http://threebean.org/presentations/images/fedmsg-flock14-img/twitter-diagram.png
 12 @@ -12,10 +10,8 @@
 13   
 14   ----
 15   
 16 - Take this
 17 - =========
 18 - It's dangerous out there
 19 - ~~~~~~~~~~~~~~~~~~~~~~~~
 20 + It's dangerous to go alone! Take this!
 21 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 22   
 23   .. code:: bash
 24   
 25 @@ -26,10 +22,8 @@
 26   
 27   ----
 28   
 29 - Your first
 30 - ==========
 31 - fedmsg script
 32 - ~~~~~~~~~~~~~
 33 + Your first fedmsg script
 34 + ~~~~~~~~~~~~~~~~~~~~~~~~
 35   
 36   .. code:: python
 37   
 38 @@ -44,10 +38,8 @@
 39   
 40   ----
 41   
 42 - It's like a million voices cried out
 43 - ====================================
 44 - and then were silent
 45 - ~~~~~~~~~~~~~~~~~~~~
 46 + It's like a million voices cried out and then were silent
 47 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 48   
 49   .. code:: python
 50   
 51 @@ -65,10 +57,8 @@
 52   
 53   ----
 54   
 55 - Some config
 56 - ===========
 57 - at the top
 58 - ~~~~~~~~~~
 59 + Some config at the top
 60 + ~~~~~~~~~~~~~~~~~~~~~~
 61   
 62   .. code:: python
 63   
 64 @@ -83,10 +73,8 @@
 65   
 66   ----
 67   
 68 - So
 69 - ==
 70 - meta
 71 - ~~~~
 72 + So meta
 73 + ~~~~~~~
 74   
 75   .. code:: python
 76   
 77 @@ -110,10 +98,8 @@
 78   
 79   ----
 80   
 81 - A picture
 82 - =========
 83 - is worth a thousand words
 84 - ~~~~~~~~~~~~~~~~~~~~~~~~~
 85 + A picture is worth a thousand words
 86 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 87   
 88   .. code:: python
 89   
 90 @@ -136,10 +122,6 @@
 91           print "Cleaning up %r" % filename
 92           os.remove(filename)
 93   
 94 - ----
 95 - 
 96 - :data-x: r1600
 97 - :data-y: 0
 98   
 99   Intermezzo
100   ==========
101 @@ -150,11 +132,6 @@
102   But... if we want to move to the next step, we have to take a break from our
103   happy hacking to go and deal with Twitter, its API, and API keys.
104   
105 - ----
106 - 
107 - :data-x: r1600
108 - :data-y: 0
109 - 
110   The Twitter API
111   ===============
112   
113 @@ -169,16 +146,8 @@
114   We will keep those tokens a secret and our little bot will use them to login
115   and tweet on our behalf.  You'll get **four** secret strings.
116   
117 - ----
118 - 
119 - :data-x: r0
120 - :data-y: r900
121 - 
122 - 
123 - Storing
124 - =======
125 - those secrets
126 - ~~~~~~~~~~~~~
127 + Storing those secrets
128 + ~~~~~~~~~~~~~~~~~~~~~
129   
130   First, add a directory called ``fedmsg.d/`` to your current working directory.
131   
132 @@ -201,12 +170,10 @@
133   
134   ----
135   
136 - Using
137 - =====
138 - those secrets
139 - ~~~~~~~~~~~~~
140 + Using those secrets
141 + ~~~~~~~~~~~~~~~~~~~
142   
143 - Go back to ``badgebot.py`` and add the following:
144 + Go back to ``wordcloudbot.py`` and add the following:
145   
146   .. code:: python
147   
148 @@ -223,10 +190,8 @@
149   
150   ----
151   
152 - And
153 - ===
154 - further down
155 - ~~~~~~~~~~~~
156 + And further down
157 + ~~~~~~~~~~~~~~~~
158   
159   .. code:: python
160   
161 @@ -254,17 +219,11 @@
162   Does it work?
163   =============
164   
165 - ----
166 - 
167 - :data-x: r1600
168 - :data-y: 0
169   
170 - systemd
171 - =======
172 - for real
173 - ~~~~~~~~
174 + systemd for real
175 + ~~~~~~~~~~~~~~~~
176   
177 - Make a new file called ``badgebot.service`` with these contents::
178 + Make a new file called ``wordcloudbot.service`` with these contents::
179   
180       [Unit]
181       Description=A Twitter bot for your Fedora Badges.  Wow.
182 @@ -272,7 +231,7 @@
183       Documentation=http://fedmsg.com
184   
185       [Service]
186 -     ExecStart=/usr/local/bin/badgebot.py
187 +     ExecStart=/usr/local/bin/wordcloudbot.py
188       Type=simple
189       User=fedmsg
190       Group=fedmsg
191 @@ -280,10 +239,6 @@
192       [Install]
193       WantedBy=multi-user.target
194   
195 - ----
196 - 
197 - :data-x: r0
198 - :data-y: r900
199   
200   install.sh
201   ==========
202 @@ -291,10 +246,10 @@
203   .. code:: bash
204   
205       #!/bin/bash -x
206 -     # install.sh - (re)install and (re)start the badgebot
207 +     # install.sh - (re)install and (re)start the wordcloudbot
208   
209       # Install our script
210 -     cp badgebot.py /usr/local/bin/badgebot.py
211 +     cp wordcloudbot.py /usr/local/bin/wordcloudbot.py
212   
213       # Make sure no one else can read our secrets.
214       cp fedmsg.d/twitter-secrets.py /etc/fedmsg.d/.
215 @@ -302,15 +257,15 @@
216       chmod o-r /etc/fedmsg.d/twitter-secrets.py
217   
218       # Copy in service file for systemd
219 -     cp badgebot.service /usr/lib/systemd/system/badgebot.service
220 +     cp wordcloudbot.service /usr/lib/systemd/system/wordcloudbot.service
221       systemctl daemon-reload
222 -     systemctl restart badgebot
223 +     systemctl restart wordcloudbot
224   
225   ----
226   
227   Watch the journal::
228   
229 -     sudo journalctl -u badgebot --follow
230 +     sudo journalctl -u wordcloudbot --follow
231   
232   - Presented by Ralph Bean
233   - http://github.com/ralphbean
234 @@ -325,10 +280,12 @@
235   .. image:: http://threebean.org/presentations/images/fedmsg-flock14-img/creative-commons.png
236   http://threebean.org/presentations/
237   
238 - fedmsg
239 - ======
240 - what it is
241 - ~~~~~~~~~~
242 + 
243 + 
244 + 
245 + 
246 + fedmsg: what it is?
247 + ===================
248   
249   
250   The `Fedora Infrastructure Message Bus <http://fedmsg.com>`_ is a
251 @@ -354,10 +311,8 @@
252   <http://fedmsg.com/en/latest/deployment>`_ from time to time.
253   
254   
255 - fedmsg
256 - ======
257 - what do?
258 - ~~~~~~~~
259 + fedmsg: what it do?
260 + ~~~~~~~~~~~~~~~~~~~
261   
262   There are two aspects to this workshop:
263   
264 @@ -394,10 +349,8 @@
265       sudo yum install python-fedmsg-meta-fedora-infrastructure
266   
267   
268 - A taste
269 - =======
270 - of the bus
271 - ~~~~~~~~~~
272 + A taste of the bus
273 + ~~~~~~~~~~~~~~~~~~
274   
275   Clone the repo from https://github.com/ralphbean/fedmsg2gource
276   
277 @@ -413,18 +366,14 @@
278   
279   
280   
281 - Explore
282 - =======
283 - the datagrepper API
284 - ~~~~~~~~~~~~~~~~~~~
285 + Explore the datagrepper API
286 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
287   
288   https://apps.fedoraproject.org/datagrepper
289   
290   
291 - say
292 - ===
293 - you wanted your own local bus
294 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295 + say you wanted your own local bus
296 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297   
298   .. code:: bash
299   
300 @@ -451,10 +400,8 @@
301       )
302   
303   
304 - if
305 - ==
306 - you want to consume
307 - ~~~~~~~~~~~~~~~~~~~
308 + if you want to consume
309 + ~~~~~~~~~~~~~~~~~~~~~~
310   
311   .. code:: bash
312   
313 @@ -480,10 +427,8 @@
314       }
315   
316   
317 - consuming messages
318 - ==================
319 - from python
320 - ~~~~~~~~~~~
321 + consuming messages from python
322 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
323   
324   .. code:: python
325   
326 @@ -493,10 +438,8 @@
327           print topic, msg
328   
329   
330 - consuming messages
331 - ==================
332 - with a daemon
333 - ~~~~~~~~~~~~~
334 + consuming messages with a daemon
335 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
336   
337   ``fedmsg-hub`` is a daemon that can make writing your own
338   long-running consumers simpler.  There are `docs on fedmsg.com
339 @@ -517,10 +460,8 @@
340               pprint.pprint(message)
341   
342   
343 - consuming messages
344 - ==================
345 - at the command line... an aside
346 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347 + consuming messages at the command line... an aside
348 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349   
350   There are lots of fun options to ``fedmsg-tail`` like ``--terse``.
351   
352 @@ -540,16 +481,16 @@
353       https://fedoraproject.org/w/index.php?title=Flock:Rideshare&diff=prev&oldid=347430
354   
355   
356 - things that use fedmsg
357 + Things that use fedmsg
358   ======================
359 + 
360 + 
361   there's a lot of them at this point
362   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
363   
364   
365 - koji
366 - ====
367 - stalk
368 - ~~~~~
369 + koji stalk
370 + ~~~~~~~~~~
371   
372   David Aquilina's (dwa's) `koji stalk
373   <http://dwa.fedorapeople.org/wip/koji-stalk.py>`_ monitors koji over fedmsg and
374 @@ -557,10 +498,8 @@
375   
376   ----
377   
378 - FAS2Trac (ftl)
379 - ==============
380 - (fama updater)
381 - ~~~~~~~~~~~~~~
382 + FAS2Trac (ftl) (fama updater)
383 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
384   
385   herlo's `FAS2Trac fama updater (ftl)
386   <https://git.fedorahosted.org/cgit/ftl.git>`_ listens to messages indicating
387 @@ -570,10 +509,8 @@
388   
389   ----
390   
391 - compose
392 - =======
393 - downloader
394 - ~~~~~~~~~~
395 + compose downloader
396 + ~~~~~~~~~~~~~~~~~~
397   
398   p3ck's `fedmsg-download <https://github.com/p3ck/fedmsg-download/>`_
399   listens for messages that the daily branched and rawhide compose
400 @@ -582,10 +519,8 @@
401   
402   ----
403   
404 - synchronization
405 - ===============
406 - of package ACLs
407 - ~~~~~~~~~~~~~~~
408 + synchronization of package ACLs
409 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
410   
411   So, it **used** to be that when someone was granted *commit* access to a
412   package in the `Fedora PackageDB (pkgdb)
413 @@ -606,10 +541,8 @@
414   
415   ----
416   
417 - notifications
418 - =============
419 - to email, irc, the desktop, and android
420 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
421 + notifications to email, irc, the desktop, and android
422 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
423   
424   There's the new `FMN system <https://apps.fedoraproject.org/>`_ that can
425   deliver notifications to you via irc, email, and android.
426 @@ -625,6 +558,7 @@
427   
428   reports
429   =======
430 + 
431   10 ways from sunday
432   ~~~~~~~~~~~~~~~~~~~
433   
434 @@ -638,10 +572,6 @@
435   
436   ----
437   
438 - reports
439 - =======
440 - 10 ways from sunday
441 - ~~~~~~~~~~~~~~~~~~~
442   
443   There's also the `Release Engineering Dashboard
444   <https://apps.fedoraproject.org/releng-dash>`_ which grabs data from
445 @@ -675,15 +605,3 @@
446   
447   There are many **message consuming services** already in place.. but we can
448   likely make many more.  Which is why you're here, no?
449 - 
450 - 
451 - 
452 - Does it work?  Debug!
453 - 
454 - ----
455 - 
456 - :data-x: r1600
457 - :data-y: 0
458 - 
459 - Open Hacking Time
460 - =================