[App] Is there a way to get the novel image at full resolution knowing the ID on novel updates?

Discussion in 'Tech Discussion' started by UnbarredStream, Oct 21, 2017.

  1. UnbarredStream

    UnbarredStream Well-Known Member

    Joined:
    Jul 25, 2017
    Messages:
    23
    Likes Received:
    34
    Reading List:
    Link
    I'm making a Novel Updates client for android, but in some parts the novel images are in too low resolution (like 60x85), but in the novel info the image is at full resolution, the problem is that the low resolution uses a generic path (/img/series_[id].jpg) but the full resolution uses the name of the file when was uploaded (/images/[uploaded date]/[uploaded name].jpg) is there an ajax api or something to get the novel image at full resolution?

    Here's a preview of the app:
     
  2. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    AFAIK, NU doesn't have an API. The thing that you can do though, is take the novel's info page (the HTML), and look for the part where the full image is located, because the image's full URL would be inside an img tag. The process might be a bit slow though, depending on the user's connection.

    So simply put, you scrap the image from the novel info page.
     
  3. UnbarredStream

    UnbarredStream Well-Known Member

    Joined:
    Jul 25, 2017
    Messages:
    23
    Likes Received:
    34
    Reading List:
    Link
    Yes i have considered that option, but the loading Time and the data usage increases too much
     
  4. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    If the images have arbitrary names, then I'm afraid that's your only option.
     
  5. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    There's no API, no OAuth2, not even HTTPS (and, by extension, this also implies NU doesn't take advantage of HTTP/2 performance improvements).

    Since mapping novel ID to cover URL doesn't require authentication you can always host your own middleware API. Servers are cheap, especially for lightweight tasks like this.

    Still, some covers are >500kB, so the additional ~11kB won't really make that much a difference for those cases.