Supported services for now:
- Heroku: https://yohooks.com/heroku/[your-yo-username]/ will Yo you when your app is deployed
- CircleCI: https://yohooks.com/circleci/[your-yo-username]/ will Yo you when your tests are done
- Runscope: https://yohooks.com/runscope/[your-yo-username]/ will Yo you when your tests are done
- GitHub: https://yohooks.com/github/[your-yo-username]/ will Yo you when code is pushed
- Generic Yo: https://yohooks.com/justyo/[your-yo-username]/ a generic webhook url that sends just a Yo
In your terminal:
heroku addons:create deployhooks:http --url=https://yohooks.com/heroku/[your-yo-username]/
In your GitHub repo settings -> webhooks:
#Contribute
- Many providers support webhooks, but each provider has a different payload.
- Webhooks are HTTP POST requests which means that if you want to receive it you'll need a server running and parsing these incoming requests.
- Sometimes you just want a simple push notification to your phone when something happens, providers don't support push notifications mostly, but they do support webhooks.
- This project means you don't need to run a server, you don't need to parse the payload, basically you don't need anything besides the Yo app to receive the pushes.
- The URLs are predifined for you to paste in your provider webhook configuration.
- Each supported provider (like heroku, circleci, etc..) has a python module with a single function called
translate
- Example 1, Example 2, Example 3 - The
translate
function accepts a Flask request and translates its payload into a very short string. - A Flask server runs and listens to webhooks from supported providers.
- Once a provider trigger a webhook, the server takes the request's payload and
translate
s it into the short string. - A Yo with the short string is sent to the username provided by the webhook URL path.
Submissions for more providers are welcome.
Heroku's docs describe the payload here:
All we need is the deployed app name. So the translate function is:
def translate(request):
text = 'Deployed ' + request.form.get('app')
return text
That's it. It's that simple.