Archived
4
2

17 Commits

Author SHA1 Message Date
Roan Horning
082ea4069d Merge pull request '[I31] Fix URL to individual series page on series index page' (#32) from I31_Fix-URL into main
Reviewed-on: #32
2022-08-26 00:17:33 +00:00
dfbb4a24db Add missing MACRO absolute_path to link path 2022-08-25 20:10:21 -04:00
4e1d525e6e Merge branch 'main' of repo.anhonesthost.net:rho_n/hpr_generator 2022-08-19 22:20:17 -04:00
694c100bcf Add command line option all
Use --all or -a when calling site-generator instead of special page
ALL to generate all the configured pages for a website.
2022-08-19 22:19:50 -04:00
52a314f2a9 Add command line option all
Use --all or -a when calling site-generator instead of special page
ALL to generate all the configured pages for a website.
2022-08-19 22:11:38 -04:00
b36293e52f Fix generation of series general page 2022-08-19 21:25:14 -04:00
02eb8313d3 Fix links in intro text of index page 2022-08-18 21:26:57 -04:00
ff2ced6774 Fix capitalization of introduction text on index page 2022-08-18 21:19:32 -04:00
0dc5a78dae Fix links in sitemap content template 2022-08-18 17:55:42 -04:00
9d0e8d403d Fix importing of template date plugin
Add USE directive to import date plugin. Worked locally with out it
in this file, but was needed when trying on a different machine.
2022-08-18 17:39:17 -04:00
5af4d93c8c Update links to HPR total feeds 2022-08-17 23:42:45 -04:00
cf001df9ec Add feed hpr_total
This includes all three audio type feeds
2022-08-17 22:41:59 -04:00
6d4f5f28c9 Refactor main feed to need fewer templates
Add configuration properties to minimize the number of templates
needed to generate the different audio format feeds.
2022-08-17 22:32:32 -04:00
17ef26642a Add page Will my show be of interest to hackers 2022-08-17 21:30:54 -04:00
91349eb504 Update links to main RSS feeds in page.tpl.html 2022-08-17 19:20:22 -04:00
83c188465d Fix setting of RSS feed enclosures mime-type
Mime-type does not always match file extension.
2022-08-17 19:16:22 -04:00
41a18300eb Allow page to configure root_template in configuration file
RSS commits will be broken before this commit.
2022-08-17 19:13:42 -04:00
16 changed files with 108 additions and 44 deletions

View File

@@ -26,7 +26,7 @@ Generate two specific pages:
`site-generator index about`
Generate the whole site:
`site-generator ALL`
`site-generator --all`
Generate pages based on the same template:
`site-generator correspondent=1,3,5..10`

View File

@@ -0,0 +1,14 @@
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title>Will my show be of intrest to hackers ?</title>
<style>
p {font-size:100px;}
</style>
</head>
<body>
<p>
YES !
</p>
</body><!-- If you are reading this then definately YES --></html>

View File

@@ -8,6 +8,7 @@
site-generator [OPTION]... PAGE|PAGE=<comma separated list of ids>...
-a, --all generate all pages defined in configuration file
-l, --list print list of configured pages
-p, --preview print generated pages to standard out
-q, --quiet suppress progress information while generating pages
@@ -23,7 +24,7 @@
site-generator index about
Generate the whole site:
site-generator ALL
site-generator --all
Generate pages based on the same template:
site-generator correspondent=1,3,5..10
@@ -92,33 +93,32 @@ exit main();
sub main {
# Argument parsing
my $all;
my $preview;
my $verbose;
my $quiet;
GetOptions(
'all' => \$all,
'list' => \&print_available_pages,
'preview' => \$preview,
'verbose' => \$verbose,
'quiet' => \$quiet,
) or pod2usage(1);
pod2usage(1) unless @ARGV;
pod2usage(1) unless @ARGV || $all;
my (@page_args) = @ARGV;
if ($quiet) {
$verbose = 'quiet';
};
# Set flag indicating whether or not to generate all pages.
# The flag is set to true if the special argument ALL is
# passed into the generator
my $ALL = grep { $_ eq 'ALL' } @page_args;
# Load config file
read_config "site.cfg" => my %config;
my $tt = get_template_html($config{DBI});
if ($ALL) {
# If command line option all is set, parse configuration file
# for all pages
if ($all) {
@page_args = keys %config;
# Remove non page sections of the configuration file
@@ -131,7 +131,13 @@ sub main {
if (exists($config{$parsed_arg{'page'}})) {
my $page_config = $config{$parsed_arg{'page'}};
$page_config->{'page'} = $parsed_arg{'page'};
$page_config->{'root_template'} = $config{root_template}{content};
# Set page's root_template to the default root_template if the
# page root_template property is not set in the configuration file.
if (exists $page_config->{'root_template'} == 0) {
$page_config->{'root_template'} = $config{root_template}{content};
}
if (exists $config{root_template}{baseurl}) {
$page_config->{'baseurl'} = $config{root_template}{baseurl};
}
@@ -260,7 +266,7 @@ sub get_filename {
else {
$filename = $$config{'filename'};
my $padded_index = "";
if ($$config{'id'}) {
if (exists $$config{'id'}) {
$padded_index = sprintf("%04d", $$config{'id'});
}
$filename =~ s/\[id\]/$padded_index/;

View File

@@ -134,15 +134,38 @@ content: content-sitemap.tpl.html
[hpr_ogg]
root_template: rss.tpl.xml
content: rss-hpr_ogg.tpl.xml
content: rss-hpr.tpl.xml
filename: hpr_ogg.rss
media_file_extension: ogg
[hpr_mp3]
root_template: rss.tpl.xml
content: rss-hpr_mp3.tpl.xml
content: rss-hpr.tpl.xml
filename: hpr_mp3.rss
media_file_extension: mp3
audio_mime_type: mpeg
[hpr_spx]
root_template: rss.tpl.xml
content: rss-hpr_spx.tpl.xml
content: rss-hpr.tpl.xml
filename: hpr_spx.rss
media_file_extension: spx
[hpr_total_ogg]
root_template: rss.tpl.xml
content: rss-hpr_total.tpl.xml
filename: hpr_total_ogg.rss
media_file_extension: ogg
[hpr_total_mp3]
root_template: rss.tpl.xml
content: rss-hpr_total.tpl.xml
filename: hpr_total_mp3.rss
media_file_extension: mp3
audio_mime_type: mpeg
[hpr_total_spx]
root_template: rss.tpl.xml
content: rss-hpr_total.tpl.xml
filename: hpr_total_spx.rss
media_file_extension: spx

View File

@@ -3,22 +3,22 @@
<hr>
<article>
<header>
<h3>welcome to hpr the community podcast</h3>
<h3>Welcome to HPR the Community Podcast</h3>
</header>
<!--% USE date %-->
<!--% delta = date.calc.N_Delta_YMD(2005,9,19, date.format(date.now, '%Y'),date.format(date.now, '%m'),date.format(date.now, '%d')) %-->
<p>we started producing shows as <a href="/twat.php"><em>today with a techie</em></a> on 2005-09-19, <!--% delta.0 %--> years, <!--% delta.1 %--> months, <!--% delta.2 %--> days ago. our shows are produced by <a href="<!--% absolute_path(baseurl) %-->correspondents/index.html">listeners</a> like you and can be on any <a href="<!--% absolute_path(baseurl) %-->eps/index.html">topic</a> that <strong>"are of interest to <a href="https://en.wikipedia.org/wiki/hacker_(hobbyist)">hackers</a>"</strong>. if you listen to hpr then please consider contributing one show a year. if you <a href="<!--% absolute_path(baseurl) %-->contribute.html">record</a> your show now it could be <a href="/calendar.php">released</a> in <strong>13</strong> days.</p>
<h4>meet the team</h4>
<p>We started producing shows as <a href="https://www.hackerpublicradio.org/twat.php"><em>Today with a Techie</em></a> on 2005-09-19, <!--% delta.0 %--> years, <!--% delta.1 %--> months, <!--% delta.2 %--> days ago. our shows are produced by <a href="<!--% absolute_path(baseurl) %-->correspondents/index.html">listeners</a> like you and can be on any <a href="<!--% absolute_path(baseurl) %-->eps/index.html">topic</a> that <strong>"are of interest to <a href="https://en.wikipedia.org/wiki/hacker_(hobbyist)">hackers</a>"</strong>. if you listen to HPR then please consider contributing one show a year. if you <a href="<!--% absolute_path(baseurl) %-->contribute.html">record</a> your show now it could be <a href="https://www.hackerpublicradio.org/calendar.php">released</a> in <strong>13</strong> days.</p>
<h4>Meet the team</h4>
<p>
<audio controls preload="none">";
<source src="../media/promos/all-hpr-hosts.ogg" type="audio/ogg" >
<source src="../media/promos/all-hpr-hosts.mp3" type="audio/mpeg" >
<source src="<!--% absolute_path(baseurl) %-->media/promos/all-hpr-hosts.ogg" type="audio/ogg" >
<source src="<!--% absolute_path(baseurl) %-->media/promos/all-hpr-hosts.mp3" type="audio/mpeg" >
</audio>
</p>
</article>
<hr>
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
<h1>latest shows</h1>
<h1>Latest Shows</h1>
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<!--% FOREACH latest_episodes IN DBI.query('
SELECT
@@ -49,7 +49,7 @@
<br>Hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(latest_episodes.hostid) %-->.html"><!--% latest_episodes.host %--></a> on <!--% latest_episodes.date %--> is flagged as <!--% display_explicit(latest_episodes.explicit) %--> and released under a <!--% latest_episodes.license %--> license. <br>
<strong>Tags:</strong> <!--% latest_episodes.tags %--><em></em>.<br>
<small>listen in <a href="local/hpr<!--% latest_episodes.id %-->.ogg">ogg</a>, <a href="local/hpr<!--% latest_episodes.id %-->.spx">spx</a>, or <a href="local/hpr<!--% latest_episodes.id %-->.mp3">mp3</a> format. <!--% show_series(latest_episodes.series, latest_episodes.seriesid) %-->
<a href="eps.php?id=3628#comments">comments (0)</a></small>
<a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(latest_episodes.id) %-->/index.html#comments">View comments.</a></small>
</p>
</header>
<!--% latest_episodes.notes %-->

View File

@@ -16,7 +16,7 @@
GROUP BY series) AS ep ON ep.series = miniseries.id
ORDER BY name'
) %-->
<h2><a href="series/<!--% zero_pad_left(series.id) %-->.html"><!--% series.name %--></a></h2>
<h2><a href="<!--% absolute_path(baseurl) %-->series/<!--% zero_pad_left(series.id) %-->.html"><!--% series.name %--></a></h2>
<ul>
<li>Number of episodes: <!--% series.number_of_episodes %--></li>
<li>Open/closed: <!--% display_choice(series.private, 'closed', 'open') %--></li>

View File

@@ -1,12 +1,12 @@
<!--% PROCESS 'shared-utils.tpl.html' %-->
<h1>Sitemap</h1>
<ul>
<li><a href="https://www.hackerpublicradio/calendar.html"><strong>⇧Upload⇧</strong></a> ← Upload Your Show</li>
<li><a href="https://www.hackerpublicradio/calendar.php"><strong>⇧Upload⇧</strong></a> ← Upload Your Show</li>
<li><a href="<!--% absolute_path(baseurl) %-->index.html"><strong>Home</strong></a> ← The HPR Homepage</li>
<li><a href="<!--% absolute_path(baseurl) %-->syndication.html">Get Shows</a> ← The RSS Syndication Feeds</li>
<ul>
<li><a href="<!--% absolute_path(baseurl) %-->correspondents/index.html">Full Episode Guide</a> ← Complete list of all the Shows.</li>
<li><a href="<!--% absolute_path(baseurl) %-->series.html">In-Depth Series</a> ← Overview of the In-Depth Series.</li>
<li><a href="<!--% absolute_path(baseurl) %-->series/index.html">In-Depth Series</a> ← Overview of the In-Depth Series.</li>
<li><a href="<!--% absolute_path(baseurl) %-->download.html">Download Options</a> ← How to download the entire archive.</li>
</ul>
<li><a href="<!--% absolute_path(baseurl) %-->contribute.html">Give Shows</a> ← Upload your podcast show here.</li>

View File

@@ -6,9 +6,9 @@
Use this feed to get the archived episodes. The feed themselves run over 15Mb in size and so use them to download the archived episodes and when you are up to date switch back to the Two Week Feeds listed above.
</p>
<ul>
<li><a href="hpr_total_ogg_rss.php">ogg feed</a> Warning over 50G</li>
<li><a href="hpr_total_spx_rss.php">spx feed</a> Warning over 22G</li>
<li><a href="hpr_total_rss.php">mp3 feed</a> Warning over 36G</li>
<li><a href="<!--% absolute_path(baseurl) %-->hpr_total_ogg.rss">ogg feed</a> Warning over 50G</li>
<li><a href="<!--% absolute_path(baseurl) %-->hpr_total_spx.rss">spx feed</a> Warning over 22G</li>
<li><a href="<!--% absolute_path(baseurl) %-->hpr_total_mp3.rss">mp3 feed</a> Warning over 36G</li>
</ul>
</article>
<article>

View File

@@ -20,9 +20,9 @@
}
</style>
<link rel="shortcut icon" href="hpr.ico" >
<link rel="alternate" type="application/rss+xml" title="Hacker Public Radio Ogg Vorbis RSS" href="/hpr_ogg_rss.php" />
<link rel="alternate" type="application/rss+xml" title="Hacker Public Radio Speex RSS" href="/hpr_spx_rss.php" />
<link rel="alternate" type="application/rss+xml" title="Hacker Public Radio MP3 RSS" href="/hpr_mp3_rss.php" />
<link rel="alternate" type="application/rss+xml" title="Hacker Public Radio Ogg Vorbis RSS" href="<!--% absolute_path(baseurl) %-->hpr_ogg.rss" />
<link rel="alternate" type="application/rss+xml" title="Hacker Public Radio Speex RSS" href="<!--% absolute_path(baseurl) %-->hpr_spx.rss" />
<link rel="alternate" type="application/rss+xml" title="Hacker Public Radio MP3 RSS" href="<!--% absolute_path(baseurl) %-->hpr_mp3.rss" />
<link rel="alternate" type="application/rss+xml" title="Hacker Public Radio Comments RSS" href="/comments_rss.php" />
<link rel="license" title="cc by 3.0" href="https://creativecommons.org/licenses/by-sa/3.0/" />
<link href="<!--% absolute_path(baseurl) %-->css/hpr.css" rel="stylesheet" />

View File

@@ -1,5 +1,5 @@
<!--% PROCESS 'shared-item.tpl.xml' %-->
<!--% PROCESS 'rss-query-hpr.tpl.xml' %-->
<!--% FOREACH episode IN feed_result %-->
<!--% display_item(episode, 'mp3') %-->
<!--% display_item(episode, media_file_extension, audio_mime_type) %-->
<!--% END %-->

View File

@@ -1,5 +0,0 @@
<!--% PROCESS 'shared-item.tpl.xml' %-->
<!--% PROCESS 'rss-query-hpr.tpl.xml' %-->
<!--% FOREACH episode IN feed_result %-->
<!--% display_item(episode, 'ogg') %-->
<!--% END %-->

View File

@@ -1,5 +0,0 @@
<!--% PROCESS 'shared-item.tpl.xml' %-->
<!--% PROCESS 'rss-query-hpr.tpl.xml' %-->
<!--% FOREACH episode IN feed_result %-->
<!--% display_item(episode, 'spx') %-->
<!--% END %-->

View File

@@ -0,0 +1,5 @@
<!--% PROCESS 'shared-item.tpl.xml' %-->
<!--% PROCESS 'rss-query-hpr_total.tpl.xml' %-->
<!--% FOREACH episode IN feed_result %-->
<!--% display_item(episode, media_file_extension, audio_mime_type) %-->
<!--% END %-->

View File

@@ -0,0 +1,22 @@
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<!--% query_hpr_feed = DBI.prepare('
SELECT
eps.id,
eps.explicit,
strftime(\'%H:%M:%S %d:%m:%Y\', date(eps.date)) AS date,
eps.license, eps.duration,
eps.title, eps.summary, eps.tags,
eps.notes,
hosts.local_image,
hosts.hostid,
hosts.host, hosts.email,
miniseries.name AS series, miniseries.id AS seriesid
FROM eps
INNER JOIN hosts ON eps.hostid = hosts.hostid
INNER JOIN miniseries ON eps.series = miniseries.id
WHERE eps.date < date(\'now\', \'+1 days\')
ORDER BY eps.date DESC
')
%-->
<!--% feed_result = query_hpr_feed.execute() %-->

View File

@@ -1,3 +1,4 @@
<!--% USE date %-->
<!--% PROCESS 'shared-utils.tpl.html' %-->
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"

View File

@@ -1,5 +1,8 @@
<!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% MACRO display_item(episode, media_type) BLOCK %-->
<!--% MACRO display_item(episode, file_extension, audio_mime_type) BLOCK %-->
<!--% IF audio_mime_type == "" %-->
<!--% audio_mime_type = 'ogg' %-->
<!--% END %-->
<item>
<itunes:explicit><!--% display_explicit_feed(episode.explicit) %--></itunes:explicit>
<googleplay:explicit><!--% display_explicit_feed(episode.explicit) %--></googleplay:explicit>
@@ -14,7 +17,7 @@
<itunes:summary><![CDATA[<!--% episode.notes %-->]]>
</itunes:summary>
<pubDate><!--% format_feed_date(episode.date) %--></pubDate>
<enclosure url="http://hackerpublicradio.org/eps/hpr<!--% zero_pad_left(episode.id) %-->.<!--% media_type %-->" length="<!--% episode.duration * 1000 %-->" type="audio/<!--% media_type %-->"/>
<guid>http://hackerpublicradio.org/eps/hpr<!--% zero_pad_left(episode.id) %-->.<!--% media_type %--></guid>
<enclosure url="http://hackerpublicradio.org/eps/hpr<!--% zero_pad_left(episode.id) %-->.<!--% file_extension %-->" length="<!--% episode.duration * 1000 %-->" type="audio/<!--% audio_mime_type %-->"/>
<guid>http://hackerpublicradio.org/eps/hpr<!--% zero_pad_left(episode.id) %-->.<!--% file_extension %--></guid>
</item>
<!--% END %-->