ChanThreadWatch icon indicating copy to clipboard operation
ChanThreadWatch copied to clipboard

use APIs instead of parsing HTML

Open bui opened this issue 9 years ago • 3 comments

especially important for archives, because (on mine) a fair amount of requests are from CTW and it wastes valuable CPU time generating HTML

https://github.com/4chan/4chan-API https://foolfuuka.readthedocs.org/en/latest/code_guide/documentation/api.html

bui avatar Oct 20 '15 17:10 bui

This is indeed a long overdue change. I feared the APIs didn't expose all the information CTW needs for all its features. I'll take a look and see if that's still the case whenever I can.

SuperGouge avatar Oct 20 '15 18:10 SuperGouge

Do you know how you would implement .json handling (While also supporting boards without this)? I have working prototypes, but I wouldn't want to try and ham-fist something in. The only thing I can see that the API doesn't expose at all is getting CrossLinks, but those, we could still parse out of the post text field.

If the user downloads the .html, it would still need to make a request for the html AFAIK.

DerSandmann-Badcode avatar Oct 30 '15 19:10 DerSandmann-Badcode

The SiteHelper could behave differently depending on what you provide it (HtmlParser, Json, ...).

As you pointed out, the only use case where using the API would be beneficial is when the user doesn't want to download the HTML (only media). I don't think that's the most popular use case for CTW but maybe I'm wrong.

SuperGouge avatar Oct 31 '15 00:10 SuperGouge