I’m going to change the call for recommendations and the invocation of agolo. Appernetly we already have the access to the summaries, so I can use a POST request to get the documents with their summaries, and hence reduce the respond time significantly.

POST https://sphere-dev.outbrain.com/Omakase/sphere/v1/summaryByContent/
Authorization: {API_KEY key-goes-here}
Content-Type: application/json
Cache-Control: no-cache
  "url" : "http://money.cnn.com/2016/11/30/technology/netflix-download-feature/index.html"

Ok, so I only get the summary, without any other information. I will still have to call a summation service. Maybe I should just add a function, that will live alongside the agolo’s one. This way I can switch between the two endpoints in the future.

Changed the get_summary function. I added support for sphere summary, and prioritized it over agolo. If there’s an issue with sphere, I try the agolo summation.

Also, I managed to solve the issue with the formating of the publish date I get from sphere. This answer in stack-overflow helped me with the reformating.