“Casares News” API
Api that scrapes and provides the last news of the city of Carlos Casares by semantic way (RDF format).
Usage
Consume the articles by: https://casares-news.herokuapp.com/articles/
Indicate the file format using the content-type header. Supports JSON-LD
, rdf/xml
, turtle
, n-triples
and n3
.
E.g.: Get the lastest 5 news in JSON-LD format
ARTICLES="https://casares-news.herokuapp.com/articles/"
HEADER="Content-Type: application/ld+json"
curl "$ARTICLES?start=0&offset=5" -H $HEADER
You can see other examples in the frontend app: https://pastorsin.github.io/casares-news/
Local execution
Requirements
Install
- Install dependencies and perform the initial migrations
make install
- Optional: Generate a private key for the webpush notifications
make webpush-gen
- Optional: Put the generated key in the .env file
<div class="highlight highlight-source-shell position-relative" data-snippet-clipboard-copy-content="WP_PRIVATE_KEY=
“>
WP_PRIVATE_KEY=<enter_private_key>