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 hub server #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions Postman Docs/PodcastIndex.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,59 @@
{
"name": "hub",
"item": [
{
"name": "Pub Notify (Hub)",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "https://hub.podcastindex.org/pubnotify",
"host": [
"https://hub.podcastindex.org"
],
"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 @@ -1514,6 +1567,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
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
2 changes: 2 additions & 0 deletions api_src/root.yaml
Original file line number Diff line number Diff line change
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
85 changes: 85 additions & 0 deletions docs/pi_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,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 @@ -1538,6 +1583,9 @@
{
"$ref": "#/components/parameters/url_pubnotify"
},
{
"$ref": "#/components/parameters/reason_liveonly"
},
{
"$ref": "#/components/parameters/pretty"
}
Expand Down Expand Up @@ -2284,6 +2332,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
76 changes: 76 additions & 0 deletions docs/pi_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,40 @@ paths:
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
/pubnotify:
get:
tags:
- Hub
summary: Pub Notify (Hub)
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: []
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 @@ -1416,6 +1450,7 @@ paths:
parameters:
- $ref: '#/components/parameters/id_feed_podcast_pi_pubnotify'
- $ref: '#/components/parameters/url_pubnotify'
- $ref: '#/components/parameters/reason_liveonly'
- $ref: '#/components/parameters/pretty'
responses:
'200':
Expand Down Expand Up @@ -2172,6 +2207,47 @@ components:
schema:
type: string
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.


To just send an `update` podping, the `podping` parameter can be used instead.
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.


Parameter shall not have a value
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.


To just send an `update` podping, use the [https://hub.podcastindex.org/pubnotify](#get-/pubnotify) server instead.
schema:
type: string
enum:
- ''
- live
- liveEnd
example: ''
chash:
name: chash
in: query
Expand Down
Loading