Issung / GChan

Scrape boards & threads from 4chan. Download images, videos and HTML if desired.
GNU General Public License v3.0
65 stars 10 forks source link

Improve performance by removing JSON -> XML conversion. #23

Closed Issung closed 1 year ago

Issung commented 1 year ago

This is a headache from YChan (which got forked into GChan by me). The 4chan API returns JSON, and then it is converted into XML so that XPATH can be used on it, which is kind of like querying it.

XPath example: image

Apparently there is a JSON alternative in Newtonsoft, which we already have as a dependency: https://www.newtonsoft.com/json/help/html/QueryJsonSelectTokenJsonPath.htm\

This will improve performance and also make the code less convoluted.

NOTE: This is less complicated for board searching and thread imagelink searching, the html page scraping is a bit more tricky. Try the prior options first.