Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WebSub push support #379

Closed
wants to merge 13 commits into from
Closed

Conversation

coldacid
Copy link
Member

This PR adds functionality to announce updates to a WebSub server, and reference that server in the RSS feed so that the podcast listeners can subscribe for updates via the WebSub protocol. This also lays out infrastructure for adding additional services such as Podcast Index.

For details, see https://podnews.net/article/pubsubhubbub-for-podcasters

  • I am the author of this code or the code is public domain
  • I release this code under the GPL-3.0 License

Provide a basic pingServices() function whose job will be to call the
functions which actually ping each individual service.
With the lone exception of the cron update of the RSS, since we should
only ping services when we know something has actually changed (or the
admin fakes it explicitly).
This page will host configuration settings for integrated services.
Provide a default WebSub hub for new sites, and simply add the setting
itself without a value for upgrades so that existing users can decide
whether or not to use WebSub pushes.
This adds a function to send a WebSub publish message to the configured
server, and adds that function to the pingServices() function so it will
be called whenever the podcast updates.
There's no point in sending WebSub messages to a hub if subscribers to
the podcast cannot subscribe via the hub. Add a link in the RSS feed
that points clients towards the hub that we are using for pushing
update messages.
That was a dumb typo.
Since there aren't any other third-party integrations in place at this
time, we'll keep things in pg_config.php and revert this particular
commit when adding in other integrations.
@coldacid coldacid force-pushed the websub-push branch 2 times, most recently from 3589db1 to 00a137b Compare February 2, 2021 01:33
Copy link
Collaborator

@emilengler emilengler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far just change this minor thing please

PodcastGenerator/core/feed_generator.php Outdated Show resolved Hide resolved
PodcastGenerator/setup/createconf.php Outdated Show resolved Hide resolved
@emilengler
Copy link
Collaborator

Btw there is still one thing to note! Could you add a function_exists before a curl function and exit if it is not found? I don't want another php dependency, in this case php-curl.

See: https://www.php.net/manual/en/function.function-exists.php

Check for the curl_init function. If it exists, so do curl_setopt,
curl_exec, and curl_close. curl_setopt_array exists in PHP 5.1.3 when
cURL is available from PHP, but not in earlier versions; iterate the
options array when this is the case.
@coldacid
Copy link
Member Author

coldacid commented Feb 5, 2021

Okay, I'm checking for the cURL module now.

@emilengler emilengler closed this in e822536 Feb 8, 2021
@emilengler
Copy link
Collaborator

Thanks

@coldacid coldacid deleted the websub-push branch July 29, 2021 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants