RSS-Bridge / rss-bridge

The RSS feed for websites missing it
https://rss-bridge.org/bridge01/
The Unlicense
7.36k stars 1.04k forks source link

Associated Press broken for all except "Top News" #4319

Closed mtalexan closed 3 weeks ago

mtalexan commented 3 weeks ago

Describe the bug

It appears the Associated Press changed their tag names for almost all the pre-defined categories except the "Top News", "Fact Check", and "Photo Galleries".

To Reproduce Steps to reproduce the behavior:

  1. Open the RSS-Hub instance main page
  2. Expand the Associated Press source
  3. Pick any/all categories other than "Top News", "Fact Check", or "Photo Galleries"
  4. See error

Expected behavior Page loads with results

Screenshots

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context

From the Bridge details, the base URL for the APNews API is https://afs-prod.appspot.com/api/v2/feed/tag?tags= and the tag for the specific category is added from a pre-defined list. The tags almost all start with apf- and then use CamelCase or all-lowercase. However, with some simple guesswork it appears they've recently switched everything except their "Top News" category to remove the prefix and switch to all-lower kebab-case for the tags now.

PR incoming.

mtalexan commented 3 weeks ago

I was mistaken about the search, it looks like the actual AP News API was broken for a bit and may not have been resolving tag searches based on tag IDs properly.
The API from appspot doesn't appear to be officially documented, but is what everyone seems to be using, and from playing around with it it looks like the tag search accepts either an explicit tag ID or a tag canonical name. The canonical name is usually an all lowercase kebab-style name, while the ID could be any of a variety of styles. The current bridge uses the ID, so there's no need/benefit to changing that.

It looks like it's back up now so I'm closing the issue.