-
-
Notifications
You must be signed in to change notification settings - Fork 17
Feed
Davide Santangelo edited this page Oct 17, 2022
·
3 revisions
RSS is a type of web feed that allows users and applications to access updates to online content in a standardized, computer-readable format — RSS Wiki.
Feeds can be created only with a write permissions token
All feeds have some of the following properties, with required properties in bold:
Field | Description |
---|---|
id | The feed's unique UUID. |
title | The title of the feed. |
description | The description of the feed. |
url | the url of the feed. |
categories | the categories of the feed. |
rank | the rank of the feed provided by OpenRank. |
status | the status of the feed 'enabled/disabled'. |
created_at | The create row DateTime. |
updated_at | The update row DateTime. |
entries_count | the number of entries. |
language | the language of the feed. |
last_import_at | the datetime of last import. |
# GET /feeds
RestClient.get "https://<your.host>/api/feeds", { Authorization: "Token #{TOKEN}" }
{
"data": [
{
"id": "27c3f611-48e4-41fa-b0bb-c89bdda2db83",
"type": "feed",
"attributes": {
"title": "Apple Newsroom",
"description": "",
"url": "feed:https://www.apple.com/newsroom/rss-feed.rss",
"status": "enabled",
"entries_count": 20,
"last_import_at": 1555675203
}
},
{
"id": "923d5997-ce13-41d4-98ca-8feb8513cdd4",
"type": "feed",
"attributes": {
"title": "NYT > Technology",
"description": "",
"url": "http://feeds.nytimes.com/nyt/rss/Technology",
"status": "enabled",
"entries_count": 40,
"last_import_at": 1555675203
}
}
]
}
# GET /feeds/:id
RestClient.get "https://<your.host>/api/feeds/{id}", { Authorization: "Token #{TOKEN}" }
# POST /feeds
payload = { url: "http://www.repubblica.it/rss/homepage/rss2.0.xml" }.to_json
headers = { Authorization: "Token #{TOKEN}", content_type: :json, accept: :json }
RestClient.post("https://<your.host>/api/feeds", payload, headers)
# GET /feeds/popular
RestClient.get "https://<your.host>/api/feeds/popular", { Authorization: "Token #{TOKEN}" }