Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Check for updates to pages using API endpoint #29

@Frewacom

Description

@Frewacom

texttv.nu has an API-endpoint that checks for updates of pages based on the date_updated_unix field. This should be implemented and used to determine whether or not a cached page should be re-fetched or not.

API endpoint:

https://texttv.nu/api/updated/<page(s)>/<unix date for cached page>?app=<id>

Responses

The following responses are for a single page (100), but it is possible to fetch for multiple pages at once by separating them with comma. The res array will then contain the updated pages of those specified in the URL. This allows us to batch cached pages together if needed.

No update available:

{
  "is_ok": true,
  "update_available": false,
  "res": [] 
}

Update available:

{
  "is_ok": true,
  "update_available": true,
  "res": [
    {
      "id": "29548492",
      "page_num": "100",
      "date_updated": "2021-02-18 07:58:43",
      "title": "Flera på FHM hotas - får nu polisskydd | Ökning av unga som sökte skuldsanering | Inrikes",
      "date_added": "2021-02-18 07:58:43"
    }
  ]
}

This would also be useful for creating notifications (#25), since we can store the previous unix date for certain pages, e.g. page 101-102 and check for updates without parsing the page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiImplementation of the APIparserImplementation of the API response parser

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions