SuperGouge / ChanThreadWatch

Fork of the original discontinued ChanThreadWatch.
90 stars 13 forks source link

use APIs instead of parsing HTML #58

Open bui opened 9 years ago

bui commented 9 years ago

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

SuperGouge commented 8 years ago

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.

DerSandmann-Badcode commented 8 years ago

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.

SuperGouge commented 8 years ago

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.