Archived
4
2

Compare commits

..

No commits in common. "51d328203bf03d420ce4986b3ed1ad9c5327a116" and "faac8c202e16c4b40d2cc96d1ec9aa999d6df1cb" have entirely different histories.

3 changed files with 74 additions and 102 deletions

View File

@ -26,15 +26,17 @@
<hr> <hr>
<article> <article>
<header> <header>
<h3>Welcome to HPR, the Community Podcast</h3> <h3>Welcome to HPR the Community Podcast</h3>
</header> </header>
<!--% days_till_next_episode = 0 %--> <!--% days_till_next_episode = 0 %-->
<!--% USE DBI(constants.driver, constants.user, constants.password) %--> <!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<!--% FOREACH next_available_episode_result IN DBI.query(query_next_available_episode) %--> <!--% FOREACH next_available_episode_result IN DBI.query(query_next_available_episode)
<!--% days_till_next_episode = next_available_episode_result.delta_days %--> %-->
<!--% END %-->
<!--% USE date %--> <!--% USE date %-->
<!--% calc = date.calc %--> <!--% calc = date.calc %-->
<!--% days_till_next_episode = calc.Delta_Days(date.format(date.now, '%Y'),date.format(date.now, '%m'),date.format(date.now, '%d'),next_available_episode_result.last_year,next_available_episode_result.last_month,next_available_episode_result.last_day) %-->
<!--% END %-->
<!--% 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')) %--> <!--% 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="<!--% absolute_path(baseurl) %-->eps/index.html#twat_episodes"><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_url(baseurl) %-->about.html#so_you_want_to_record_a_podcast">record</a> your show now it could be <a href="<!--% hub_baseurl %-->calendar.php">released</a> in <strong><!--% days_till_next_episode %--></strong> days.</p> <p>We started producing shows as <a href="<!--% absolute_path(baseurl) %-->eps/index.html#twat_episodes"><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_url(baseurl) %-->about.html#so_you_want_to_record_a_podcast">record</a> your show now it could be <a href="<!--% hub_baseurl %-->calendar.php">released</a> in <strong><!--% days_till_next_episode %--></strong> days.</p>
</article> </article>

View File

@ -1,32 +1,17 @@
<!--% query_next_available_episode = ' <!--% query_next_available_episode = '
WITH next_id AS ( WITH next_id AS (
SELECT id, id + 1 AS id_next, date as last_date SELECT id, id + 1 AS \'id_next\', date as \'last_date\'
FROM eps FROM eps
WHERE eps.date > NOW() WHERE eps.date > NOW()
), )
free_slot AS ( SELECT
SELECT MIN(next_id.id_next) AS \'next_id\',
last_date AS prev_date, DATE_FORMAT(DATE_ADD(MIN(last_date), INTERVAL 1 DAY), \'%Y\') AS \'last_year\',
CASE DATE_FORMAT(DATE_ADD(MIN(last_date), INTERVAL 1 DAY), \'%d\') AS \'last_day\',
WHEN DAYOFWEEK(last_date) = 6 DATE_FORMAT(DATE_ADD(MIN(last_date), INTERVAL 1 DAY), \'%m\') AS \'last_month\'
THEN 3 FROM next_id
ELSE 1 LEFT JOIN eps ON next_id.id_next = eps.id
END AS date_offset, WHERE eps.id IS NULL
next_id.id_next AS empty_slot
FROM next_id
LEFT JOIN eps ON next_id.id_next = eps.id
WHERE eps.id IS NULL
ORDER BY next_id.id
LIMIT 1
)
SELECT
empty_slot AS next_id,
ADDDATE(prev_date,date_offset) AS next_date,
YEAR(ADDDATE(prev_date,date_offset)) AS last_year,
MONTH(ADDDATE(prev_date,date_offset)) AS last_month,
DAY(ADDDATE(prev_date,date_offset)) AS last_day,
DATEDIFF(ADDDATE(prev_date,date_offset),NOW()) AS delta_days
FROM free_slot
' '
%--> %-->
<!--% query_latest_episodes = ' <!--% query_latest_episodes = '

View File

@ -1,32 +1,17 @@
<!--% query_next_available_episode = ' <!--% query_next_available_episode = '
WITH next_id AS ( WITH next_id AS (
SELECT id, id + 1 AS id_next, date as last_date SELECT id, id + 1 AS \'id_next\', date as \'last_date\'
FROM eps FROM eps
WHERE eps.date > date(\'now\') WHERE eps.date > date(\'now\')
), )
free_slot AS ( SELECT
SELECT MIN(next_id.id_next) AS \'next_id\',
last_date AS prev_date, strftime(\'%Y\', DATE (MIN (last_date), \'+1 Days\')) AS \'last_year\',
CASE strftime(\'%d\', DATE (MIN (last_date), \'+1 Days\')) AS \'last_day\',
WHEN strftime(\'%w\',last_date) = \'5\' strftime(\'%m\', DATE (MIN (last_date), \'+1 Days\')) AS \'last_month\'
THEN \'+3 days\' FROM next_id
ELSE \'+1 days\' LEFT JOIN eps ON next_id.id_next = eps.id
END AS date_offset, WHERE eps.id IS NULL
next_id.id_next AS empty_slot
FROM next_id
LEFT JOIN eps ON next_id.id_next = eps.id
WHERE eps.id IS NULL
ORDER BY next_id.id
LIMIT 1
)
SELECT
empty_slot AS next_id,
DATE (prev_date, date_offset) AS next_date,
strftime(\'%Y\', DATE (prev_date, date_offset)) AS last_year,
strftime(\'%m\', DATE (prev_date, date_offset)) AS last_month,
strftime(\'%d\', DATE (prev_date, date_offset)) AS last_day,
printf(\'%i\',abs(julianday(DATE (prev_date, date_offset)) - julianday(\'now\') + 1)) AS delta_days
FROM free_slot
' '
%--> %-->
<!--% query_latest_episodes = ' <!--% query_latest_episodes = '