通过slack中的斜杠命令执行trello操作

slack_to_trello的Python项目详细描述


Build Status

通过slack中的斜杠命令执行trello操作

当前迭代是概念的证明;目前只支持1个slack团队、1个trello用户和1个trello列表。将来,我们希望通过与trello的oauth集成(将slack用户连接到trello用户)和一些选择板的机制(从slack或服务器上的映射)来支持多个团队和板。

转换

/trello slash command

进入

/trello response message

开始

要获得slack-to-trello运行的副本,请执行以下步骤:

# Clone our repository
git clone https://github.com/underdogio/slack-to-trello
cd slack-to-trello/

# Install our dependencies
pip install -r requirements.txt

# Install our module as a dependency of itself (meta)
python setup.py develop

# The remaining steps are for setting up our configuration
# We will be building `slack_to_trello/config/env`
# We start by copying `env.test`
cp slack_to_trello/config/env.test slack_to_trello/config/env

# Create 2 Slack integrations (1 for receiving slash commands, 1 for sending messages)
# First Slack integration: Slash Commands
#   Open your browser to Slash Commands
#   https://my.slack.com/services/new/slash-commands
#   Command: "/trello"
#   URL: "https://my-server/slack/message"
#     Please replace `my-server` with your server location
#     Don't forget to host it on HTTPS
#   Method: "POST"
#   Token: Provided by Slack
#   Autocomplete -> Description: "Add a Trello card on the Engineering board"
#   Autocomplete -> Help text: "[card subject]"
#   Descriptive Label: "slack-to-trello"
#   Click "Save Integration"
# Once saved, add the "Token" field as `SLACK_TOKEN` into `env`
#   `export SLACK_TOKEN=token_from_slack`
# Second Slack integration: Incoming WebHooks
#   These will be replies upon successful Trello card additions
#   Open your browser to Incoming WebHooks
#   https://my.slack.com/services/new/incoming-webhook
#   Post to Channel: Pick any channel -- we will always be overriding this
#   Webhook URL: Provided by Slack
#   Descriptive Label: "slack-to-trello messages"
#   Customize Name: "slack-to-trello"
#   Customize Icon: Pick any you like -- we recommend `:signal_strength:`
#   Click "Save Settings"
# Once saved, add the "Webhook URL" field as `SLACK_MESSAGE_URL` into `env`
#   `export SLACK_MESSAGE_URL=https://hooks.slack.com/services/path/to/reply`
# Set up our Trello integration
#   We recommend creating a bot user as all cards
#   will be marked as "Created by" the chosen user
# Collect our Trello API information
#   Open our browser to https://trello.com/app-key
#   Save "Key" as `TRELLO_API_KEY` in `env`
#   `export TRELLO_API_KEY=value_from_key`
# Generate a permanent Trello API token (this can be disabled later on)
#   Using the "Key" as "TRELLO_API_KEY" and "Secret" as "TRELLO_API_SECRET"
TRELLO_API_KEY=key_from_website TRELLO_API_SECRET=secret_from_website bin/generate-trello-tokens.py
#   You will be prompted to open a link
#   Follow the link and click "Accept"
#   Copy the standalone value from the page
#   Go back to the command line and enter "y"
#   You will be prompted for a PIN
#   Paste the value from the page
#   You will be given an `oauth_token` and `oauth_token_secret` value
# Save `oauth_token` as `TRELLO_TOKEN` in `env`
#   `export TRELLO_TOKEN=value_from_oauth_token`
# Find the board/list we want to add cards to
# List our boards and their ids via:
bin/list-trello-boards.py [TRELLO_API_KEY][TRELLO_TOKEN]# Find the board we want and record its id as `TRELLO_BOARD_ID` in `env`
#   `export TRELLO_BOARD_ID=target_board_id`
# Output the board lists and their ids via:
bin/list-trello-board-lists.py [TRELLO_API_KEY][TRELLO_TOKEN][TRELLO_BOARD_ID]# Find the list we want and record its id as `TRELLO_LIST_ID` in `env`
#   `export TRELLO_LIST_ID=target_board_id`
# Start our server (default port is 5000)
./run.sh
# An alternative port can be chosen via the `PORT` environment variable
# PORT=6000 ./run.sh
# You should now be able to send a `/trello` command in Slack

文档

测试

我们的测试是通过nosetests支持的,但是需要在手动操作之前设置特定的环境变量。要运行我们的测试,请执行以下步骤:

# Install our development dependencies
pip install -r requirements-dev.txt

# Run our tests
./test.sh

贡献

代替正式的形式指南,注意保持现有的编码风格。为任何新的或更改的功能添加单元测试。通过./test.sh进行测试。

许可证

版权所有(c)2015 underdog.io

根据麻省理工学院的许可证。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在windows上的eclipse中运行nutch 1.9?   登录JavaWebApp并显示jsp模板   Java测试字符串处理   java如何在MVC中为模型创建junit测试   java使用。替换密码   java如何在一个面板上添加3个不同的数字(垂直排列)?   JPanel和组合框上的java背景图像   java查找包含重复项的最小缺失数   你好。我是新来的。很抱歉我正在尝试让此文件读取器与构造函数一起运行。。。但坦率地说。它不起作用了   当我使用Intellij IDEA开发java程序时,总会有一个调试配置窗口。那我连编码都不会   使用改型响应时出现java空指针异常   Java如何获取没有全名的文件   java是否可以通过Selenium RC加载外部javascript?   java如何从另一个模块maven导入类   java JPanel的工作方式与它的设计预览不一样   java递归线性搜索堆栈溢出错误   java如何防止从一个数据库导出到另一个数据库时“自动编号”字段发生冲突?   JavaGoogleAppEngine推送任务始终返回405