YoApp / yo-hooks

Predefined URLs for your webhooks

Home Page:https://yohooks.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slack Status

Yo Hooks

Simple predefined URLs for your webhooks.

Supported services for now:

How to add Heroku webhook:

In your terminal: heroku addons:create deployhooks:http --url=https://yohooks.com/heroku/[your-yo-username]/

How to add GitHub webhook:

In your GitHub repo settings -> webhooks:



How to add XCode webhook:


#Contribute

Motivation

  • 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.

How?

  • 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 translates 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.

Examples

How to create a translate function

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.

About

Predefined URLs for your webhooks

https://yohooks.com


Languages

Language:Python 100.0%