griffithchaffee / wormstorysearch-rails

Rails application for tracking Worm fanfiction updates
http://wormstorysearch.com
24 stars 5 forks source link

All Ratings not taken into account on Sufficient Velocity #9

Closed cmptrwz closed 5 years ago

cmptrwz commented 5 years ago

The threadmark code in use across the XenForo sites includes a data-likes attribute that accurately represents the likes on the threadmarked chapter. Only the likes. It doesn't take into account any other ratings, so if a story has lots of Funny ratings they aren't counted towards chapter totals.

It looks like the code to do a crawl of the entire set of ratings is there, at least at a quick glance (I'm not all that familiar with Ruby in general), but the code that reads the Threadmark list seems like it may mark chapters as having been updated so that crawling for the complete set of ratings doesn't happen. I think.

griffithchaffee commented 5 years ago

Good catch. Funny enough before knowing about the data-likes I parsed the chapter's html with all the different types of likes. Then saw the attribute and figured it could all be simplified. Should not be hard to revert back to the previous behavior.

cmptrwz commented 5 years ago

Looks like you did some work on this, but I had a thought. Are you using reader mode to check all the likes? A quick loop over the reader mode pages, which look to have the same post numbers and all, would let you get 10 story posts per page load, instead of having to make a request for each post by ID or similar. For Mauling Snarks (I'm the author, I can be biased towards using it as an example) that's currently 17 page loads instead of 168, if you currently make one request per main threadmark post.

griffithchaffee commented 5 years ago

SV ratings fixed in a54cd40f3e17260c8583b1439f63b977f6b6c2b6 @cmptrwz I will definitely look into using the reader mode to save queries (#10), great idea!