{"id":20551562,"url":"https://github.com/do-community/rss-reader-api","last_synced_at":"2025-04-14T11:25:58.427Z","repository":{"id":46721715,"uuid":"292087846","full_name":"do-community/rss-reader-api","owner":"do-community","description":"RSS Reader API written  in Django Rest","archived":false,"fork":false,"pushed_at":"2024-06-05T16:24:14.000Z","size":37,"stargazers_count":44,"open_issues_count":0,"forks_count":28,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T00:41:55.235Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/do-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-01T19:22:28.000Z","updated_at":"2025-01-17T09:31:15.000Z","dependencies_parsed_at":"2024-11-16T02:32:20.389Z","dependency_job_id":"7e2a9a19-96e9-4223-8e1d-353f6ded8ae0","html_url":"https://github.com/do-community/rss-reader-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-community%2Frss-reader-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-community%2Frss-reader-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-community%2Frss-reader-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-community%2Frss-reader-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/do-community","download_url":"https://codeload.github.com/do-community/rss-reader-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248870431,"owners_count":21175041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-11-16T02:32:13.442Z","updated_at":"2025-04-14T11:25:58.405Z","avatar_url":"https://github.com/do-community.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rss-reader-api\nRSS Reader API written in Django Rest. This app provides a REST API using the \nDjango Rest Framework that aggregates articles from RSS feeds. This will allow \nyou to create a system of news delivery that is appropriate for you.\n\n## How To Use It\nAs a user you will be able to save RSS feeds from your favorite sites and have\nall of the data aggregated into a single news feed. You can take it one step \nfurther and set categories for each feed and filter the articles based on \ncategory. Categories are not required, but add the ability to customize your\nfeed even more.\n\n## Deployment\nDeploying the RSS Reader requires a few environment variables to be set.\n\n**Required Environment Variables**\n\n* `DJANGO_ALLOWED_HOSTS` - Django only allows access based on predefined hosts.\nBe sure to add your FQDN when ready for production. `localhost` is included by default\nOn App Platform set to `${APP_DOMAIN}`\n\n* APP_PLAT_ROUTE = \u003cURL_FOR_YOUR_API\u003e ex: `/api`\n\n*Database Env Vars*\nCan also use Database URL on App Platform \n\n`DATABASE_URL = ${db.DATABASE_URL}`\n\nor use this \n\n* `NAME` - Database name \n* `USER` - Database user to auth with\n* `PASSWORD` - Database password to auth with\n* `HOST` - Database host\n* `PORT` - Database port\n\nCode that uses these env vars\n```python\n    DATABASES = {\n        \"default\": {\n            \"ENGINE\": \"django.db.backends.postgresql_psycopg2\",\n            \"NAME\": os.environ.get(\"DB_NAME\"),\n            \"USER\": os.environ.get(\"DB_USER\"),\n            \"PASSWORD\": os.environ.get(\"DB_PASSWORD\"),\n            \"HOST\": os.environ.get(\"DB_HOST\"),\n            \"PORT\": os.environ.get(\"DB_PORT\"),\n            \"OPTIONS\": {\"sslmode\": \"require\"},\n        }\n    }\n```\n**Optional/Development Environment Variables**\n* `DJANGO_SECRET_KEY` - If you don't provide a secret key then all cookies will\nbe invalidated everytime the server reboots. If you don't set this one will be\ngenerated everytime you start the server\n* `DEVELOPMENT_MODE` - This determines whether or not to use a local sqlite db\nif True or a remote Postgres DB if False. Defaults to `False`\n* `DEBUG` - Set's Django into debug mode for more verbose error messaging. \nDefaults to `False`.\n\n### Deploy to App Platform\nTo deploy this API to App Platform visit the \n[Deploy Spec GitHub Repo](https://github.com/do-community/rss-reader-app-platform-spec)\n\n## API Spec\nAll examples are using [`httpie`](https://httpie.org/). If you haven't checked \nit out you should.\n\nBelow are all of the public endpoints currently available.\n\n**Note:** - All API methods end with a `/`. If you attempt to call an API method\nwithout this you will receive a 404.\n\n\n### POST `/login/`\nRetrieve a users API token\n\n*Parameters*\n\n* `username` - Your username\n* `password` - Your Password\n\n*Example*\n\n`http POST https://example.api/obtain-auth-token/ username=user password=pass`\n\n*Returns*\n\n```\n{\n    \"token\": \"YOUR_API_TOKEN\"\n}\n```\n\n### GET `/articles/`\nFetch articles from your news sources.\n\n*Query Parameters*\n\n* `category` (optional) - filter the results based on your categories. This\ncan be a single value or a comma separated list. Note that categories are case\nsensitive.\n* `count` (optional) - The total number of articles to fetch. Default set to 10\n* `feed` (optional) - The specific feed to get articles from. Use the feed id to\nspecify.\n\n*Example*\n\n`http https://example.api/articles/?category=Tech\u0026count=10`\n\n*Returns 200*\n```json\n[\n    {\n        \"categories\": [\n            \"Tech\"\n        ],\n        \"date\": \"DATE\",\n        \"feed_name\": \"FEED_AS_SPECIFIED_BY_YOU\",\n        \"link\": \"LINK\",\n        \"summary\": \"SUMMARY TEXT\",\n        \"title\": \"TITLE\"\n    }\n    ...\n]\n```\n\n### GET `/feeds/`\nReturns a list of all of the feeds currently being aggregated.\n\n*Query Parameters*\n\n* `category` (optional) - filter the results based on your categories. This\ncan be a single value or a comma separated list. Note that categories are case\nsensitive.\n\n*Example*\n\n`http https://example.api/feeds?category=Tech`\n\n*Returns 200*\n```json\n[\n    {\n        \"categories\": [],\n        \"id\": 1,\n        \"is_visible\": true,\n        \"name\": \"Hacker News\",\n        \"url\": \"https://hnrss.org/frontpage\"\n    },\n    ...\n]\n```\n\n### POST `/feeds/` - **Auth Required**\nAdd an RSS feed. Articles from this feed will be aggregated into the others\n\n*Parameters*\n\n* `name` - The name you wish to give this source\n* `url` - The URL of the RSS feed\n* `categories` - The category(ies) to associate the feed with. This can be a\nsingle category or a list of categories spearated by a `,`\n* `is_visible` - Whether or not you want news from this source to be visible (optional)\n\n*Example*\n\n`http POST https://example.api/feeds/ 'Authorization: Token '$TOKEN name=\"Mason Egger's Website\" url=\"https://mason.dev/index.html\" category=\"Tech,Python\"`\n\n*Returns 200*\n```json\n{\n    \"categories\": [\n        \"Tech\",\n        \"Python\"\n    ],\n    \"id\": 5,\n    \"is_visible\": true,\n    \"name\": \"My Feed\",\n    \"url\": \"https://demo.shark.codes\"\n}\n```\n\n*Returns 400*\n```\n{\n    \"errors\": {\n        \"name\": [\n            \"This field is required.\"\n        ],\n        \"url\": [\n            \"This field is required.\"\n        ]\n        \"category\": [\n            \"Invalid catogory CATEGORY.\"\n        ]\n    }\n}\n```\n\n### PUT `/feeds/` - **Auth Required**\nUpdate an RSS feed.\n\n*Parameters*\n\n* `id` - The ID of the category\n* `name` (optional) - The name you wish to give this source\n* `url` (optional) - The URL of the RSS feed\n* `is_visible` (optional) - Whether or not you want news from this source to be \nvisible\n* `category` (optional) - The category you want to associate with this feed.\nThis can be a single category or a list of categories spearated by a `,` \n\n*Example*\n\n`http PUT https://example.api/feeds/ 'Authorization: Token '$TOKEN id=16 name=\"Awesome Blog\" category=\"Tech\"`\n\n*Returns*\n```json\n{\n    \"info\": {\n        \"categories\": [\n            \"Tech\"\n        ],\n        \"id\": 16,\n        \"is_visible\": true,\n        \"name\": \"dog\",\n        \"url\": \"https://mason.dev/\"\n    },\n}\n```\n\n### DELETE `/feeds/\u003cint:feed_id\u003e` - **Auth Required**\nDelete an RSS feed. Articles from this feed will no longer appear.\n\n*URI Parameters*\n\n* `feed_id` - The ID of the feed to delete\n\n*Example*\n\n`http DELETE http://localhost:8000/feeds/\u003cFEED_ID\u003e/ 'Authorization: Token '$TOKEN`\n\n*Returns 200*\n```json\n{\n    \"message\": \"Feed was successfully deleted\",\n}\n```\n\n*Returns 404*\n```json\n{\n    \"message\": \"Class with id 5 does not exist\",\n}\n```\n\n### GET `/categories/`\nReturns a list of all of the categories currently available\n\n*Parameters*\n\nNone\n\n*Example*\n\n`http https://example.api/categories`\n\n*Returns 200*\n```json\n[\n    {\n        \"id\": 1,\n        \"name\": \"Tech\"\n    },\n    ...\n]\n```\n\n### POST `/categories/` - **Auth Required**\nAdd a a category. RSS Feeds can be tagged with categories to aide with filtering.\n\n*Parameters*\n\n* `name` - The name you wish to give this category\n\n\n*Example*\n\n`http POST https://example.api/categories/ 'Authorization: Token '$TOKEN name=\"Sports\"`\n\n*Returns 200*\n```json\n{\n    \"id\": 3,\n    \"name\": \"Sports\"\n}\n```\n\n*Returns 400*\n```\n{\n    \"errors\": {\n        \"name\": [\n            \"This field is required.\"\n        ],\n    }\n}\n```\n\n### PUT `/category/` - **Auth Required**\nUpdate a category.\n\n*Parameters*\n\n* `id` - The ID of the category\n* `name` - The name you wish to give this category\n\n\n*Example*\n\n`http PUT https://example.api/category/ 'Authorization: Token '$TOKEN id=3 name=\"Sportz\"`\n\n*Returns 200*\n```json\n{\n    \"id\": 3,\n    \"name\": \"Sportz\"\n}\n```\n\n### DELETE `/category/\u003cint:category_id\u003e` - **Auth Required**\nDelete a category. RSS Feeds will no longer be associated with this category\n\n*URI Parameters*\n\n* `feed_id` - The ID of the category to delete\n\n*Example*\n\n`http DELETE http://localhost:8000/category/\u003cCATEGORY_ID\u003e/ 'Authorization: Token '$TOKEN`\n\n*Returns 200*\n```json\n{\n    \"message\": \"Category was successfully deleted\",\n}\n```\n\n*Returns 404*\n```json\n{\n    \"message\": \"Category with id 3 does not exist\"\n}\n```\n--- \n\n## Create a Secret key\n```python\nfrom django.core.management.utils import get_random_secret_key\n\nprint(get_random_secret_key())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-community%2Frss-reader-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdo-community%2Frss-reader-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-community%2Frss-reader-api/lists"}