Updates prior to the handover to SGOTI
.make_email.cfg: New configuration file to simplify the original options to 'make_email' .make_shownotes.cfg: New configuration file to simplify the original extremely obscure options to 'make_shownotes' collect_HPR_database: Script to simplify the collection and setup of MySQL dumps from the HPR server and conversion to a SQLite database. make_email: Many changes to make the script simpler to use. It looks for all files in the same directory as the script. Reduced the number of options and added a new configuration file. Now reads and writes a date cache file (defined in the configuration file) where it writes the date and time of the next recording. Now uses a local SQLite database rather than linking to the live HPR database (more secure). Takes an output file name (with optional '%s'). Functions for loading and updating the date cache (also used by 'make_shownotes'). Doesn't attempt to generate a real mail message, just something that can be cut and pasted into a mail client. make_email_template.tpl: TT2 template for generating the mail message. This whole function was moved from the script itself to this templating system, making it all a lot simpler. make_meeting: Minor updates. This script is probably obsolete. make_shownotes: Almost totally rewritten. It looks for all files in the same directory as the script. Reduced the number of options and added a new configuration file. Now reads a date cache file (defined in the configuration file) where 'make_email' has written the date and time of the next recording. Now generates output files rather than writing to the live HPR database. These files can be added to the database on the 'hub' using existing workflow(s). One of the files generated is a stand-alone full HTML file for circulation to volunteers recording the show. The others are the HTML snippet to add to the database, and a JSON version for use in the hub workflow. The full HTML gets the expanded comments and contains markers of comments already read or missed last month. This version computes the episode number and date which will be used to post the resulting show (previously reserved slots were searched for in the database). The extremely complex query that collects comments has been thoroughly tested and enhanced and seems to be reliable. Dropped the "Any Other Business" section (and all code relating to it in the script and the template). shownote_template.tpl: Soft link to the latest template. Doing this needs consideration given that the configuration file could just reference the appropriate file. This technique may just be a nuisance. shownote_template11.tpl: Previous template, updated for the last release of 'make_shownotes'. Now replaced. shownote_template12.tpl: New template without AOB capability.
This commit is contained in:
@@ -17,9 +17,9 @@
|
||||
# Hacking"
|
||||
# AUTHOR: Dave Morriss (djm), Dave.Morriss@gmail.com
|
||||
# LICENCE: Copyright (c) year 2012-2024 Dave Morriss
|
||||
# VERSION: 0.2.2
|
||||
# VERSION: 0.2.3
|
||||
# CREATED: 2012-10-13 15:34:01
|
||||
# REVISION: 2024-05-24 22:45:56
|
||||
# REVISION: 2024-10-28 13:17:44
|
||||
#
|
||||
#===============================================================================
|
||||
|
||||
@@ -42,7 +42,7 @@ use Date::ICal;
|
||||
#
|
||||
# Version number (manually incremented)
|
||||
#
|
||||
our $VERSION = '0.2.2';
|
||||
our $VERSION = '0.2.3';
|
||||
|
||||
#
|
||||
# Script name
|
||||
@@ -65,8 +65,6 @@ my ( @startdate, @rdate, @events );
|
||||
#
|
||||
# Attributes for the calendar message
|
||||
#
|
||||
#my $server = 'ch1.teamspeak.cc';
|
||||
#my $port = 64747;
|
||||
my $server = 'chatter.skyehaven.net';
|
||||
my $port = 64738;
|
||||
|
||||
@@ -129,11 +127,12 @@ else {
|
||||
# of having a time zone defined (default UTC, as now).
|
||||
#
|
||||
my $monday = 1; # Day of week number 1-7, Monday-Sunday
|
||||
my $offset = -3; # Offset from the target date (-3 is Friday)
|
||||
|
||||
my @starttime = ( 13, 00, 00 ); # UTC
|
||||
my @endtime = ( 15, 00, 00 );
|
||||
my @starttime = ( 15, 00, 00 ); # UTC
|
||||
my @endtime = ( 17, 00, 00 );
|
||||
|
||||
my @todostart = ( 9, 00, 00 ); # UTC
|
||||
my @todostart = ( 9, 00, 00 ); # UTC
|
||||
my @todoend = ( 17, 00, 00 );
|
||||
|
||||
#
|
||||
@@ -161,12 +160,13 @@ http://hackerpublicradio.org/recording.php
|
||||
ENDDESC
|
||||
|
||||
#
|
||||
# Compute the next recording date from the starting date (@startdate will be
|
||||
# today's date or the start of the explicitly selected month provided via
|
||||
# -from=DATE. We want day of the week to be Monday, the first in the month,
|
||||
# then to go back 1 day from that to get to the Sunday! Simple)
|
||||
# Compute the next recording date from the starting date.
|
||||
# Now @startdate will be today's date or the start of the explicitly selected
|
||||
# month provided via -from=DATE. We want day of the week to be Monday, the
|
||||
# first in the month, then to go back $offset days from that to get to the
|
||||
# recording day! Simple.
|
||||
#
|
||||
@startdate = make_date( \@startdate, $monday, 1, -1 );
|
||||
@startdate = make_date( \@startdate, $monday, 1, $offset );
|
||||
@rdate = @startdate;
|
||||
|
||||
#
|
||||
@@ -208,7 +208,7 @@ for my $i ( 1 .. $count ) {
|
||||
#
|
||||
# Recording date computation from the start of the month
|
||||
#
|
||||
@rdate = make_date( \@rdate, $monday, 1, -1 );
|
||||
@rdate = make_date( \@rdate, $monday, 1, $offset );
|
||||
|
||||
#
|
||||
# Save the current recording date to make an array of arrayrefs
|
||||
@@ -305,8 +305,9 @@ exit;
|
||||
# RETURNS: The start of the month in the textual date in Date::Calc
|
||||
# format
|
||||
# DESCRIPTION: Parses the date string and makes a Date::Calc date from the
|
||||
# result where the day part is 1. Optionally checks that the
|
||||
# date isn't in the past, though $force = 1 ignores this check.
|
||||
# result where the day part is forced to be 1. Optionally
|
||||
# checks that the date isn't in the past, though $force
|
||||
# = 1 ignores this check.
|
||||
# THROWS: No exceptions
|
||||
# COMMENTS: Requires Date::Calc and Date::Parse
|
||||
# Note the validation 'die' has a non-generic message
|
||||
|
Reference in New Issue
Block a user