slack

What are some ways to post python pandas dataframes to slack?

不羁的心 提交于 2019-12-04 04:14:13
How can I export a pandas dataframe to slack? df.to_json() seems like a potential candidate, coupled with the slack incoming webhook, but then parsing the message to display as a nice markdown/html-ized table isn't obvious to me. Long time listener, first time caller, please go easy on me... There is a .to_html() method on DataFrames, so that might work. But if you are just looking to cut and paste, Tabulate is a good choice. From the docs: from tabulate import tabulate df = pd.DataFrame([["Name","Age"],["Alice",24],["Bob",19]]) print tabulate(df, tablefmt="grid") Returns +---+-------+-----+ |

How to integrate Apache Airflow with slack?

荒凉一梦 提交于 2019-12-03 13:13:26
问题 could someone please give me step by step manual on how to connect Apache Airflow to Slack workspace. I created webhook to my channel and what should I do with it next ? Kind regards 回答1: Create a Slack Token from https://api.slack.com/custom-integrations/legacy-tokens Use the SlackAPIPostOperator Operator in your DAG as below SlackAPIPostOperator( task_id='failure', token='YOUR_TOKEN', text=text_message, channel=SLACK_CHANNEL, username=SLACK_USER) The above is the simplest way you can use

Is it possible to post files to Slack using the incoming Webhook?

痞子三分冷 提交于 2019-12-03 11:39:38
问题 I am trying out the Slack's API using the incoming webhook feature, posting messages works flawlessly, but it doesn't seem to allow any file attachments. Looking through I understand I have to use a completely different OAuth based API, but creating more tokens just for the purpose of uploading a file seems odd when posting messages works well, is there no way to upload files to slack with the incoming webook? 回答1: No, its is not possible to upload files through an incoming Webhook. But you

Slack webhook - Which IPs should I open?

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We want to use Slack Webhook (Outgoing Webhook) with an internal web service. Our company is behind a firewall, so outside connections must be whitelisted. It appears that Slack has multiple addresses it will send the API request from, and they don't seem to be documented. Which IPs/Ports should we open in the firewall (whitelist) in order to allow slack's outgoing webhooks to connect to our internal web service? 回答1: An alternative could be using a VPN tunnel service to expose your internal webserver the Internet, e.g. with ngrok . I can

How to set slack reminder for private channel

元气小坏坏 提交于 2019-12-03 06:28:26
问题 I am able to set slack remider using /remind #public-channel but for private channel there is no option. 回答1: Found a solution for this. In case of a private-channel you can use slack inbuilt /remind command in following way: /remind @channel every weekday at 2pm to start daily standup. Here you can use either @here (to remind only online people) or @channel (remind everyone in the channel irrespective they are online). This was a nifty trick I used with my private slack channel. Wont find it

How to scale a slack bot to 1000's of teams

荒凉一梦 提交于 2019-12-03 03:33:57
To implement a slack bot, i need to deal with 'Real Time Messaging API' of slack. It is a WebSocket-based API that allows you to receive events from Slack in real time and send messages as user. more info: https://api.slack.com/rtm To create a bot for only one team , i need to open one websocket connection and listen it for events. To make available the slack bot for another team. I need to open a new websocket connection. So, 1 team => 1 websocket connection 2 teams => 2 websocket connections N teams => N websocket connections what should i do to scale my websocket connections for endless

Slack Attachment Width and Wrapping Issues

♀尐吖头ヾ 提交于 2019-12-03 02:42:47
I'm trying to use slack attachments to log application errors but the large fields like the stack trace are behaving weirdly. First, when using attachments the table seems to be fixed to some arbitrary width, is there anyway to change this so a wider value can be allowed? Otherwise 50+% of the slack window is blank, a complete waste. Using just text works fine, but there are a number of other smaller fields included that benefit from the field format. Also I'm having a problem with slack doing strange wrapping when the message is large. Below is just a small snippet with a few characters

python创建slack bot

匿名 (未验证) 提交于 2019-12-02 22:51:30
搭建环境:这边使用的是Python3 (1)使用vistualenv 创建一个与其他python项目隔离的环境 virtualenv starterbot (2) 激活virtualenv source starterbot/bin/activate (3)安装slackclient Slack构建 的官方 API帮助程序库可以发送和接收来自Slack频道的消息 pip3 install slackclient (4)登录slack官网,注册一个账号, 戳账号注册 戳slackAPI 还需要 创建一个Slack App 来为你的机器人接收一个API令牌。 使用xxx(按照喜好取名)作为你的应用程序名称。 如果你登录了多个工作区,请从下拉列表中选择一个开发工作区 (6)填入app的名字,和之前注册slack加入的workspace (7)create App之后,进入app的配置页面 (8) 我们希望我们的Starter Bot像您团队中的任何其他用户一样出现 - 它将参与渠道,小组和DM中的对话。 在Slack App中,这被称为 bot用户 ,我们通过在“功能”部分下选择“Bot Users”来设置它。 点击“Add a Bot User”后,您应该选择一个显示名称,选择一个默认的用户名,并通过点击“添加Bot用户”保存您的选择 把应用程序安装到我们的开发工作区中。

Only Primary Owner can post Message on Slack

倾然丶 夕夏残阳落幕 提交于 2019-12-02 20:47:32
问题 I have a Slack App and Workspace. Since I am the admin, I can post the message to anyone and to any channel. But, when I am trying to post a message as a different user through an api call using the method chat.postMessage, it gives me the following response. {"ok":false,"error":"missing_scope","needed":"chat:write:user","provided":"identity.basic,identity.email,identity.avatar,identity.team","warning":"missing_charset","response_metadata":{"warnings":["missing_charset"]}} I checked the Oauth

How to set slack reminder for private channel

杀马特。学长 韩版系。学妹 提交于 2019-12-02 19:55:19
I am able to set slack remider using /remind #public-channel but for private channel there is no option. Pikachu-go Found a solution for this. In case of a private-channel you can use slack inbuilt /remind command in following way: /remind @channel every weekday at 2pm to start daily standup. Here you can use either @here (to remind only online people) or @channel (remind everyone in the channel irrespective they are online). This was a nifty trick I used with my private slack channel. Wont find it on slack documentation but it works. egervais7 I was able to set the reminder for the private