Browse Source

Ubuntu RSS reader, posts into Mystic message base.

See templates/ubuntu.ini for changing the base number
we post to.

ubuntu.sh (is in the mystic directory), and runs
the script (should be rss directory).

Calls mutil ubuntu.ini if there's something to post.
Steve Thielemann 5 years ago
commit
87f7be1233
3 changed files with 147 additions and 0 deletions
  1. 8 0
      req.txt
  2. 126 0
      templates/ubuntu.ini
  3. 13 0
      ubuntu.sh

+ 8 - 0
req.txt

@@ -0,0 +1,8 @@
+feedparser==5.2.1
+Jinja2==2.10.3
+MarkupSafe==1.1.1
+pendulum==2.0.5
+pkg-resources==0.0.0
+python-dateutil==2.8.1
+pytzdata==2019.3
+six==1.13.0

+ 126 - 0
templates/ubuntu.ini

@@ -0,0 +1,126 @@
+; MUTIL configuration file
+; -------------------------------------------------------------------------
+;
+; MUTIL is an automated maintainance and utility program driven by
+; configuration files used to perform various tasks upon execution.
+;
+; The concept here is that you can create your own custom command lines to
+; complete any number of tasks.  For example, you could create msgmaint.ini
+; which executes message base purge, packing, and reply linking.  Then you
+; can simply execute "mutil msgmaint" to kick it off.
+; ==========================================================================
+; ==========================================================================
+; ==========================================================================
+
+[General]
+
+        ; list of functions to perform on startup
+
+        PostTextFiles      = true
+
+        ; Set this value if you want to run mutil from a directory other than
+        ; the root Mystic directory or the mysticbbs environment variable:
+
+        ; mystic_directory=c:\mystic\mystic.dat
+
+        ; If no directory is specified in the logfile name, mUtil will attempt
+        ; to use the configured LOGS directory from in Mystic's configuration.
+        ; Comment out to disable logging completely.
+        logfile=ubuntu.log
+
+        ; If set to TRUE (*HIGHLY* recommended for MUTIL) then it will write the
+        ; log file in increments of 8KB at a time.  If set to FALSE it will write
+        ; each individual line as it is logged.  This will significantly reduce
+        ; MUTIL performance if set to FALSE.
+
+        logcache=true
+
+        ; Level 1 = basic
+        ; Level 2 = verbose
+        ; Level 3 = debug
+
+        loglevel=3
+
+        ; logfile time stamp.  defaults to NNN DD HH:II:SS if not set here
+        ;logstamp = YYYYHHMMHHIISS
+
+        ; Log roller type:
+        ;   0 = Do not roll log files
+        ;   1 = Roll by number of files/filesize
+        ;   2 = Roll by number of days
+        logtype = 2
+
+        ; number of log files to keep (0 to disable log rolling)
+        maxlogfiles = 31
+
+        ; size of each log file in kilobytes
+        maxlogsize = 1500
+
+; ==========================================================================
+; ==========================================================================
+; ==========================================================================
+
+[PostTextFiles]
+
+        ; Total number of text files to be posted.  For each file there needs to
+        ; be a file definition as show below.
+
+        totalfiles = {{ total }}
+
+        ; This defines one file which will be posted to the message base.  Each
+        ; file should be prefixed with file# where # is a number from 1 to
+        ; totalfiles.
+        ;
+        ; The delfile option (if true) will remove the filename after the message
+        ; is posted.  The baseidx is the permanent index of the message base to
+        ; post the message into (shown as Index at the top of the message base
+        ; editor in Mystic's configuration.  Address is the echomail destination
+        ; address
+        ;
+        ; file#_baseidx
+        ; 3 is Local Test Messages
+        ; 8 is fsxNet Bot Channel
+
+
+        {% for value in entries %}
+        file{{ loop.index }}_name = rss/{{ value.filename }}
+        file{{ loop.index }}_baseidx = 3
+        file{{ loop.index }}_from = bugz_ubuntu
+        file{{ loop.index }}_to = Ubuntu Users
+        file{{ loop.index }}_subj = {{ value.title }}
+        file{{ loop.index }}_addr = 0:0/0
+        file{{ loop.index }}_delfile = false
+
+        {% endfor %}
+
+        ; file1_name    = AD.txt
+        ; file1_baseidx = 8
+        ; file1_from    = bugz_bot
+        ; file1_to      = All
+        ; file1_subj    = [ASCII] BZ&BZ BBS
+        ; file1_addr    = 0:0/0
+        ; file1_delfile = false
+
+        ; file2_name    = AD110719.ANS
+        ; file2_baseidx = 8
+        ; file2_from    = bugz_bot
+        ; file2_to      = All
+        ; file2_subj    = [ANSI] BZ&BZ BBS
+        ; file2_addr    = 0:0/0
+        ; file2_delfile = false
+
+        ; file2_name    = myfile.txt
+        ; file2_baseidx = 2
+        ; file2_from    = Sysop
+        ; file2_to      = All
+        ; file2_subj    = My subject
+        ; file2_addr    = 0:0/0
+        ; file2_delfile = false
+
+; ==========================================================================
+; ==========================================================================
+; ==========================================================================
+
+
+
+

+ 13 - 0
ubuntu.sh

@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# RSS feed for Mystic
+
+rm -f ubuntu.ini
+cd rss
+bin/python ./ubuntu_load.py
+cd ..
+
+if test -f "ubuntu.ini"; then
+	./mutil ubuntu.ini
+fi
+