Skip to content

Fix New Republic and Scientific American recipes#4

Open
holyspiritomb wants to merge 3 commits intoping:mainfrom
holyspiritomb:ping
Open

Fix New Republic and Scientific American recipes#4
holyspiritomb wants to merge 3 commits intoping:mainfrom
holyspiritomb:ping

Conversation

@holyspiritomb
Copy link

@holyspiritomb holyspiritomb commented Jan 2, 2024

Explanation for New Republic

The New Republic recipe started showing HTTP 400 errors when attempting to download any article endpoints.

When an endpoint URI was input into a browser, the server gave this error message:

{"errors":[{"message":"Cannot query field \"captionText\" on type \"GalleryData\".","locations":[{"line":71,"column":7}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}},{"message":"Cannot query field \"creditText\" on type \"GalleryData\".","locations":[{"line":72,"column":7}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}]}

If I am understanding the error correctly, the New Republic recipe has fields in the query that don't appear to exist in the news site's database.

This pull request will remove the specific fields named in the above error message from the recipe's query, which enables the recipe to fetch articles again.

Explanation for Scientific American

Scientific American has changed its CSS classes. This pull request updates the keep_only_tags and extra_css accordingly, and updates the recipe to find each article's script ld+json element.

@holyspiritomb holyspiritomb changed the title Fix New Republic recipe Fix New Republic and Scientific American recipes Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant