Skip to content

Commit

Permalink
Add hub.podcastindex.org endpoint and podping parameters to hubnotify
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencrader committed Sep 18, 2023
1 parent b162026 commit 9199f15
Show file tree
Hide file tree
Showing 10 changed files with 306 additions and 4 deletions.
63 changes: 63 additions & 0 deletions Postman Docs/PodcastIndex.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,59 @@
{
"name": "hub",
"item": [
{
"name": "Pub Notify (Hub)",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "{{baseHubUrl}}/pubnotify",
"host": [
"{{baseHubUrl}}"
],
"path": [
"pubnotify"
],
"query": [
{
"key": "id",
"value": "75075",
"description": "The PodcastIndex Feed ID\n\nThe `id` or the `url` is required.",
"disabled": true
},
{
"key": "url",
"value": "https://feeds.theincomparable.com/batmanuniversity",
"description": "The Podcast Feed URL\n\nThe `id` or the `url` is required.",
"disabled": true
},
{
"key": "reason",
"value": "",
"description": "Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with the specified reason.\n\nTo just send an `update` podping, the `podping` parameter can be used instead.\n",
"disabled": true
},
{
"key": "podping",
"value": "",
"description": "Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with an `update` reason.\n\nParameter shall not have a value\n",
"disabled": true
},
{
"key": "pretty",
"value": "",
"description": "If present, makes the output “pretty” to help with debugging.\n\nParameter shall not have a value\n",
"disabled": true
}
]
},
"description": "Notify the index that a feed has changed\n\nNote: No API key needed for this endpoint.\n\nExamples:\n - https://api.podcastindex.org/api/1.0/hub/pubnotify?id=920666&pretty\n - https://api.podcastindex.org/api/1.0/hub/pubnotify?url=https://feeds.theincomparable.com/batmanuniversity&pretty\n"
},
"response": []
},
{
"name": "Pub Notify",
"request": {
Expand Down Expand Up @@ -1508,6 +1561,12 @@
"description": "The Podcast Feed URL\n\nThe `id` or the `url` is required.",
"disabled": true
},
{
"key": "reason",
"value": "",
"description": "Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with the specified reason.\n\nTo just send an `update` podping, use the [https://hub.podcastindex.org/pubnotify](#get-/pubnotify) server instead.\n",
"disabled": true
},
{
"key": "pretty",
"value": "",
Expand Down Expand Up @@ -1801,6 +1860,10 @@
{
"key": "baseAppleUrl",
"value": "https://api.podcastindex.org/"
},
{
"key": "baseHubUrl",
"value": "https://hub.podcastindex.org/"
}
]
}
11 changes: 11 additions & 0 deletions api_src/components/parameters/podping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: podping
in: query
# language=Markdown
description: |
Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with an `update` reason.
Parameter shall not have a value
schema:
type: boolean
allowEmptyValue: true
15 changes: 15 additions & 0 deletions api_src/components/parameters/reason.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: reason
in: query
# language=Markdown
description: |
Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with the specified reason.
To just send an `update` podping, the `podping` parameter can be used instead.
schema:
type: string
enum:
- ""
- "live"
- "liveEnd"
example: ""
15 changes: 15 additions & 0 deletions api_src/components/parameters/reason_liveonly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: reason
in: query
# language=Markdown
description: |
Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with the specified reason.
To just send an `update` podping, use the [https://hub.podcastindex.org/pubnotify](#get-/pubnotify) server instead.
schema:
type: string
enum:
- ""
- "live"
- "liveEnd"
example: ""
34 changes: 34 additions & 0 deletions api_src/paths/hub/hub.pubnotify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
get:
tags:
- Hub
summary: Pub Notify (Hub)
# language=Markdown
description: |
Notify the index that a feed has changed
Note: No API key needed for this endpoint.
Examples:
- https://hub.podcastindex.org/pubnotify?id=920666&pretty
- https://hub.podcastindex.org/pubnotify?url=https://feeds.theincomparable.com/batmanuniversity&pretty
operationId: pubnotify
security: [] # no security required
servers:
- url: https://hub.podcastindex.org
description: "Server for handling feed publish/update notifications"
parameters:
- $ref: '../../components/parameters/id_feed_podcast_pi_pubnotify.yaml'
- $ref: '../../components/parameters/url_pubnotify.yaml'
- $ref: '../../components/parameters/reason.yaml'
- $ref: '../../components/parameters/podping.yaml'
- $ref: '../../components/parameters/pretty.yaml'
responses:
'200':
$ref: '../../components/responses/hub_pubnotify.yaml'
'400':
$ref: '../../components/responses/400.yaml'
'401':
$ref: '../../components/responses/401.yaml'
1 change: 1 addition & 0 deletions api_src/paths/hub/pubnotify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ get:
parameters:
- $ref: '../../components/parameters/id_feed_podcast_pi_pubnotify.yaml'
- $ref: '../../components/parameters/url_pubnotify.yaml'
- $ref: '../../components/parameters/reason_liveonly.yaml'
- $ref: '../../components/parameters/pretty.yaml'
responses:
'200':
Expand Down
4 changes: 3 additions & 1 deletion api_src/root.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.2
info:
version: 1.11.0
version: 1.11.1
title: PodcastIndex.org API
termsOfService: 'https://github.com/Podcastindex-org/legal/blob/main/TermsOfService.md'
contact:
Expand Down Expand Up @@ -233,6 +233,8 @@ paths:
$ref: 'paths/stats/current.yaml'
'/categories/list':
$ref: 'paths/categories/list.yaml'
'/pubnotify':
$ref: 'paths/hub/hub.pubnotify.yaml'
'/hub/pubnotify':
$ref: 'paths/hub/pubnotify.yaml'
'/add/byfeedurl':
Expand Down
87 changes: 86 additions & 1 deletion docs/pi_api.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.2",
"info": {
"version": "1.11.0",
"version": "1.11.1",
"title": "PodcastIndex.org API",
"termsOfService": "https://github.com/Podcastindex-org/legal/blob/main/TermsOfService.md",
"contact": {
Expand Down Expand Up @@ -1519,6 +1519,51 @@
}
}
},
"/pubnotify": {
"get": {
"tags": [
"Hub"
],
"summary": "Pub Notify (Hub)",
"description": "Notify the index that a feed has changed\n\n\nNote: No API key needed for this endpoint.\n\n\nExamples:\n\n - https://hub.podcastindex.org/pubnotify?id=920666&pretty\n - https://hub.podcastindex.org/pubnotify?url=https://feeds.theincomparable.com/batmanuniversity&pretty\n",
"operationId": "pubnotify",
"security": [],
"servers": [
{
"url": "https://hub.podcastindex.org",
"description": "Server for handling feed publish/update notifications"
}
],
"parameters": [
{
"$ref": "#/components/parameters/id_feed_podcast_pi_pubnotify"
},
{
"$ref": "#/components/parameters/url_pubnotify"
},
{
"$ref": "#/components/parameters/reason"
},
{
"$ref": "#/components/parameters/podping"
},
{
"$ref": "#/components/parameters/pretty"
}
],
"responses": {
"200": {
"$ref": "#/components/responses/hub_pubnotify"
},
"400": {
"$ref": "#/components/responses/400"
},
"401": {
"$ref": "#/components/responses/401"
}
}
}
},
"/hub/pubnotify": {
"get": {
"tags": [
Expand All @@ -1535,6 +1580,9 @@
{
"$ref": "#/components/parameters/url_pubnotify"
},
{
"$ref": "#/components/parameters/reason_liveonly"
},
{
"$ref": "#/components/parameters/pretty"
}
Expand Down Expand Up @@ -2271,6 +2319,43 @@
},
"example": "https://feeds.theincomparable.com/batmanuniversity"
},
"reason": {
"name": "reason",
"in": "query",
"description": "Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with the specified reason.\n\n\nTo just send an `update` podping, the `podping` parameter can be used instead.\n",
"schema": {
"type": "string",
"enum": [
"",
"live",
"liveEnd"
]
},
"example": ""
},
"podping": {
"name": "podping",
"in": "query",
"description": "Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with an `update` reason.\n\n\nParameter shall not have a value\n",
"schema": {
"type": "boolean"
},
"allowEmptyValue": true
},
"reason_liveonly": {
"name": "reason",
"in": "query",
"description": "Send a [podping](https://github.com/Podcastindex-org/podping-hivewriter#podping-reasons) with the specified reason.\n\n\nTo just send an `update` podping, use the [https://hub.podcastindex.org/pubnotify](#get-/pubnotify) server instead.\n",
"schema": {
"type": "string",
"enum": [
"",
"live",
"liveEnd"
]
},
"example": ""
},
"chash": {
"name": "chash",
"in": "query",
Expand Down
Loading

0 comments on commit 9199f15

Please sign in to comment.