fake-name / wlnupdates

It's a WEBSITE! Whooooo!
http://wlnupdates.com
30 stars 6 forks source link

Understanding how to get API results. #45

Closed fake-name closed 6 years ago

fake-name commented 6 years ago

Received via e-mail:

I want to have to have the rss flux for every new chapters. I used https://www.wlnupdates.com/api/get-releases but didn't get anything, is it normal ?

fake-name commented 6 years ago

That's not how the API works.

ALL api routes have the same, end point, https://www.wlnupdates.com/api. The API function is controlled by the POSTed parameters.

In this case, curl -X POST -H 'Content-Type:Application/json' -d "{ \"mode\" : \"get-feeds\" }" https://www.wlnupdates.com/api would be the way to get the rss feeds.

If you want parsed releases, you'd do something like curl -X POST -H 'Content-Type:Application/json' -d "{ \"mode\" : \"get-releases\" }" https://www.wlnupdates.com/api

Kenji94 commented 6 years ago

Hi, Sorry for the late answer, I got a lot of work recently. It's ok it's working now :)

By the way, I really don't understand the difference between get-feeds vs get-releases. Ok the format is not the same, but they don't have the same chapter releases. I'm finding gravity tales on one but royalRoadL on the other

Kenji94 commented 6 years ago

You mean rss feed vs you parse yourself some websites ?

fake-name commented 6 years ago

Yes.

get-feeds is basically just aggregated RSS content. It contains both release info, and whatever else the various sites post.

get-releases gets things that the scraper backend thinks are actually releases. Each release is associated with a specific series on wnlupdates, and contains structured data (numeric chapter/volume/part) information where possible.

Kenji94 commented 6 years ago

Thank your for your fast reply! It's a shame the scrapping of website is not legal otherwise I would have used get-release too :(

fake-name commented 6 years ago

It's a shame the scrapping of website is not legal otherwise I would have used get-release too

Uh.... what?

Kenji94 commented 6 years ago

I'm pretty sure in the term of use and policy privacy of most of the websites, there is a clause : no scrapping is allowed

fake-name commented 6 years ago

What does that have to do with the wlnupdates.com api whatsoever?

Kenji94 commented 6 years ago

For example, if I'm showing royalRoadL new chapters on an app, they can go against me as I don't have their permission

fake-name commented 6 years ago

Well, considering RoyalRoadL are literally adding API end-points for me so I can get releases more easily, I think they're fine with it?

Also, considering the hundreds of hosted RSS readers out there that do exactly that, without any issue, I don't think anyone is going to complain.

Kenji94 commented 6 years ago

Nice! So you contacted them and they gave you their api end-points ?

fake-name commented 6 years ago

No, the actually contacted me and asked if I could move away from plain scraping.

Realistically, if you have a web site on the internet, you are going to get hit by spiders. People who think otherwise are idiots.

Kenji94 commented 6 years ago

Ok. One last question :) On the mode get-feeds, why there is not a field bookName ? The only rule I have found is, if tags.size == 1, it is the bookName and it's not always exact.

fake-name commented 6 years ago

The get-feeds interface returns aggregated rss feeds. They are not associated with series.

get-releases is the get-feeds data that's been run through the feed parser system.