3 Historical Stats#4
Draft
SilkRose wants to merge 134 commits into
Draft
Conversation
Use status code for error handling with html file request.
And run prettier.
Scrapes the Rankings and Bookshelves heading 1 stats from the story stats' page.
Also changes status codes initial value to -1 for a placeholder.
Makes the sleep function use less CPU. Improves logging and skips logging error status codes. Improved sleep function written by @meadowsys.
Uses zod to validate the json parsed from the html of the stats page.
Makes the request interval a variable so it can be set in one place. Add more comments to make things more clear.
Most of the schema is in place, need to finish the included section and lower.
SQL does not like tables named Index.
Also add date joined to SQL Authors table.
Start of DB insertion, more to come later.
Validate the data with the schema for the API and stats JSON at the right times. Also remove rate limit check, FIMFiction does not have rate limiting.
Need to fix quotes in titles.
Added ranking, word ranking, bookshelves, and tracking counts, they were missing in the stories table and in the insert function.
Also, fixes select for max loop iteration.
f539b50 to
7c5cc4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds historical data scraping.