Convert the RSS feeds from php to the static site #140
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: HPR/hpr_generator#140
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tested
hpr_mp3.rss
and it looks OK except that the URL in the<link>
field was wrong. Fixed locally but not yet uploaded. The other feeds are to be tested next.There were problems with the feeds, as reported by Ken.
The most serious issue was that the
<enclosure length="...">
value was wrong due to a misunderstanding.The code that collects and inserts this value has been modified, and test RSS feeds created. After validation these changes can be added to the repository, assuming there are no other problems.
Further issues relating to the generation of the
<itunes:summary>
XML required enhancements to thesite-generator
. Now testing is complete.Check list
@davmo to maintain compatibility we need to make some changes to the static site.
The links in the static have
https
but should behttp
<googleplay:explicit>no</googleplay:explicit>
should be No or Yes - upper first letterTitle don't seem to be escaped
<title>HPR4119: Cov's Jams 003</title>
versus<title>HPR4119: Cov's Jams 003</title>
<googleplay:explicit>no</googleplay:explicit>
should be No or Yes - upper first letterA change to the macro
display_explicit_feed
inshared-utils.tpl.html
should do this.This change has already been made in the test version of the site and seems to work fine.
I need explanations of:
https
but should behttp
<title>HPR4119: Cov's Jams 003</title>
versus<title>HPR4119: Cov's Jams 003</title>
Explanations:
&
,<
,>
,'
, and"
. We stopped using the entity converter in the template to work around this. There was some debate about whether the<title>
field should contain a<![CDATA[]]>
tag, but no conclusion was reached. Please define what is required here.The title currently is not escaped, so that should be the case for the static feeds. We need the feeds to be identical for the transition. Epically the
enclosure
andguid
fields, as changes in either could be interpreted by pod catchers as a trigger to download all the episodes again.Ideally the feeds should be identical except for the
generator
.According to https://support.google.com/podcast-publishers/answer/9889544?hl=en valid values for
<itunes:explicit>
are case-sensitive 'yes' and 'no' (where absence implies 'no'). I will undo the change I made which generates values ofYes
andNo
.I couldn't find anything definitive. Downloading the DTD for this extension results in Javascript probing my machine for iTunes and refusing to do anything else because I don't have it. I never will have iTunes of course. This strategy seems to go against the design of the XML DTD as I understand it.
According to https://www.google.com/schemas/play-podcasts/1.0/play-podcasts.xsd valid values for gogleplay:explicit seem to be case-sensitive 'yes' and 'no' (where absence implies 'no'), though it's not explicit as far as I know (only lower case forms are shown in the schema). I will undo the change I made which generates values of
Yes
andNo
.The dynamic/php feeds we are replacing are deployed to thousands of people with possibly hundreds of podcatches that we know are able to parse them without issue.
The purpose of this exercise is to switch to the static feeds, with the least risk possible. That would ideally be replacing a binary compatible file. Each change we do increases the risk. So please ignore improvements and corrections for now and implement what we know is working.
Yes, of course. However, the templates that produce the static versions already contain changes which make the RSS differ from the PHP versions, so it's necessary to undo things or adjust them to make them identical. Also, there was a point last year where the embedded texts were changed to fix grammatical errors, etc. These would need to be undone to achieve binary compatibility, and so on.
As identical as possible. Each day we make changes to "display" fields, so fixing grammar in our description has a very low risk.
On the other hand anything that requires an "action" has a high risk. Highest is a change in the enclosure and the guid tags. However the Explicit flags of Google and itunes are also action flags, so should remain as they currently are.
Once we have the new feeds working, we can slowly start adding the "action" back corrections like the Google:explicit to lower case.
High risk changes of the https in the
enclosure
and theguid
tags would require a completely different approach.I have made these changes:
http_basename
) withhttp
instead ofhttps
. The templates can callabsolute_url(http_baseurl)
and be compatible with the PHP.xml_entity
in thesite-generator
to callencode_entities
which doesn't generate hex entities. This brings the static RSS in step with the PHP version except the PHP generates'
but the Perl module generates'
.display_explicit_feed
to generate 'yes/no' values I createddisplay_explicit_feed_2
to return 'Yes/No' in the few cases that are needed to match the PHP feeds.html-strip
andxml_entity
to the template generating the<title>
tag to make the static feeds look like the PHP ones.HTML::Strip
by default adds spaces when replacing tags in some cases. Turned this off.These changes have brought the two types of feeds closer together, though they are not identical.
Discovered that the PHP code is doing this in certain cases:
The original text contained an ampersand that was replaced by an entity
&
but this has been double encoded.Note: Since Gitea doesn't seem to allow RSS files to be uploaded here, I will post examples to Matrix.