Skip to content

Commit

Permalink
feat(route): use apnews api instead of official rss (down now)
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoyu committed Oct 9, 2024
1 parent 755ba8c commit 7383600
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
23 changes: 19 additions & 4 deletions lib/routes/apnews/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,28 @@ import { parseDate } from '@/utils/parse-date';

export const route: Route = {
path: '/api/:tags?',
categories: ['traditional-media'],
categories: ['traditional-media', 'popular'],
example: '/apnews/api/business',
view: ViewType.Articles,
parameters: {
tags: {
description: 'Getting a list of articles from a public API based on tags. See https://github.com/kovidgoyal/calibre/blob/81666219718b5f57d56b149a7ac017cc2a76b931/recipes/ap.recipe#L43-L46',
default: 'apf-topnews',
description: 'Getting a list of articles from a public API based on tags.',
options: [
{ value: 'business', label: 'Business' },
{ value: 'entertainment', label: 'Entertainment' },
{ value: 'Health', label: 'Health' },
{ value: 'intlnews', label: 'International News' },
{ value: 'lifestyle', label: 'Lifestyle' },
{ value: 'oddities', label: 'Oddities' },
{ value: 'politics', label: 'Politics' },
{ value: 'science', label: 'Science' },
{ value: 'sports', label: 'Sports' },
{ value: 'technology', label: 'Technology' },
{ value: 'topnews', label: 'Top News' },
{ value: 'Travel', label: 'Travel' },
{ value: 'usnews', label: 'US News' },
],
default: 'topnews',
},
},
features: {
Expand All @@ -29,7 +44,7 @@ export const route: Route = {
},
],
name: 'News',
maintainers: ['dzx-dzx'],
maintainers: ['dzx-dzx', 'pseudoyu'],
handler,
};

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/apnews/rss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const HOME_PAGE = 'https://apnews.com';

export const route: Route = {
path: '/rss/:category?',
categories: ['traditional-media', 'popular'],
categories: ['traditional-media'],
example: '/apnews/rss/business',
view: ViewType.Articles,
parameters: {
Expand Down

0 comments on commit 7383600

Please sign in to comment.