words / powerthesaurus-api

Look up English synonyms, antonyms, etc with powerthesaurus.org
https://npm.im/powerthesaurus-api
MIT License
57 stars 5 forks source link

Doesn't work #7

Open auisdhf878tyc807asdhfiunkm opened 3 years ago

auisdhf878tyc807asdhfiunkm commented 3 years ago

This doesn't seem to work anymore -- it just returns an empty array no matter what I do.

dmahfouda commented 3 years ago

I'm also experiencing this issue—

wooorm commented 3 years ago

They seem to change all the time: https://github.com/words/powerthesaurus-api/issues?q=is%3Aissue+is%3Aclosed

PRs welcome to help out with a more solid solution

wooorm commented 3 years ago

@zeke should we deprecate this perhaps? Their stuff keeps changing... 😩

zeke commented 3 years ago

@deebah or @dmahfouda this module breaks whenever the website changes its HTML structure. The last time this happened it was a one-line change because of an updated CSS class name. Are you interested in attempting to work on a fix?

ryanwbass commented 3 years ago

@zeke Hey, I am currently looking for a good thesaurus api. Based on the website this looks pretty promising and am feeling adventurous enough to contribute to something like this. Digging through the code to understand and some debugging it looks like I would have to update: done(null, $.selectAll('main .k3_b', tree).map(each)) as $.selectAll is returning []. So Im assuming that '.k3_b' element had its name changed or something along those lines.

What element from the site were you guys originally selecting with that identifier?

zeke commented 3 years ago

Hi @ryanwbass thanks for jumping in. I don't remember the historical DOM structure of the site off-hand. The best way for you to proceed would be to open the PowerThesaurus website in your browser, do a search, then see the selectors in the browser's web inspector. From there you can extrapolate and figure out what selectors would need to be changed here in this package. Hope that helps.

adnanshahri commented 2 years ago

@zeke Hi, is the issue still persistent?

@ryanwbass Have you had the chance to work on this, or did you find a better API than Power Thesaurus?