Public | Automated Build

Last pushed: 5 months ago
Short Description
Returns the estimated reading time of Radio-Canada news.
Full Description

Obamo

Returns the estimated reading time of Radio-Canada news.

Build

docker build -t obamo .
echo 'NEURO_API_KEY="{YOUR_API_KEY}"' >> neuro_api.env

Run

"Production" mode:

docker run -d \
    -p 5000:5000 \
    --name obamo \
    --env-file neuro_api.env \
    obamo

Development mode:

docker run -d \
    -p 5000:5000 \
    -e FLASK_DEBUG=1 \
    --env-file neuro_api.env \
    --name obamo \
    -v $PWD:/usr/src/app \
    obamo

API

/ping - validate the server is working:

curl http://localhost:5000/ping
pong

/readtime - get the estimated reading time for the given news story URL:

curl -X POST \
     -H 'Content-Type: application/json' \
     -d '{"url": "https://services.radio-canada.ca/hackathon2017/neuro/v1/news-stories/1023332"}'\
     http://localhost:5000/readtime
{
  "sections": {
    "body": {
      "minutes": 2,
      "seconds": 90
    },
    "summary": {
      "minutes": 1,
      "seconds": 10
    }
  },
  "total": {
    "minutes": 2,
    "seconds": 100
  }
}
Docker Pull Command
Owner
samueldg
Source Repository

Comments (0)