Giter Club home page Giter Club logo

politico_playbook's Introduction

Send a daily Politico Playbooks' audio feed to your email

Build Status

Some years ago, Politico.eu has decided to stop providing an audio feed of their Brussels Playbook to various podcasting apps. What they still provide is ML-and-AWS-powered Text-To-Speech translation (as of Q2/2020).

As a consequence, because of a large inconvenience, I wrote this Azure Function which extract the first article from https://www.politico.eu/newsletter/brussels-playbook/ and https://www.politico.eu/newsletter/london-playbook/ (aka the latest playbook), and then extracts Amazon Polly audio files from them. Then, AWS audio feed URLs are being forwarded to my email account....on the demand, based on HTTP request to Azure function endpoint.

How to setup it up for yourself?

Requirements:

  1. Fork this repo
  2. In __init__.py adjust send_us_playbook_url parameters for your emails, and sendgrid api key. 2.2. Generate Sendgrid key if you need it (you will, if using sendgrid SaaS)
  3. Setup azure account
az login
az group create --location eastus --name azure-functions
az storage account create -n dmpestorageaccount -g azure-functions --access-tier hot --https-only --kind StorageV2 --sku Standard_LRS --tags loc=eastus reason=func
az storage account update --custom-domain "storage.melive.xyz"
touch azure_blob_policy.json
az storage account management-policy create --account-name dmpestorageaccount -g azure-functions --policy "$(cat azure_blob_policy.json)"
# setup other alerting/monitoring rules as necessary

az functionapp create -n politico-brussels -c eastus -g azure-functions -s dmpestorageaccount --disable-app-insights true --os-type linux --runtime python --runtime-version 3.8 --functions-version 3 --tags reason=function

Estimated Costs

The goal was to also minimize costs as much as possible. Hence for example use of policies. According to my estimations, it should be 0.

Deployment

https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python#publishing-to-azure

https://docs.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies

# remote (preffered)
func azure functionapp publish <APP_NAME>

# local
func azure functionapp publish <APP_NAME> --build local

politico_playbook's People

Contributors

dmpe avatar

Watchers

 avatar  avatar

politico_playbook's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.