Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.14 KB

README.md

File metadata and controls

29 lines (20 loc) · 1.14 KB

flask-slackunfuddle

Proxy webhook requests from Unfuddle repositories to Slack.

Based on the slackunfuddle Sinatra app.

Motivation

Unfuddle can post to a webhook and Slack can accept incoming webhooks.

However, Unfuddle posts XML in this format:

<?xml version="1.0" encoding="UTF-8"?>
<changeset>
  <author-id type="integer"> </author-id>
  <created-at type="datetime"> </created-at>
  <id type="integer"> </id>
  <message> </message>
  <repository-id type="integer"> </repository-id>
  <revision> </revision>
</changeset>    

And Slack expects JSON in this format:

curl -X POST --data-urlencode 'payload={"text": "This is posted to <#general> and comes from *monkey-bot*.", "channel": "#general", "username": "monkey-bot", "icon_emoji": ":monkey_face:"}' https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

We need a simple web application to convert the Unfuddle XML to the JSON format expected by Slack.