The story of a person who wanted to discuss and share something with other engineers in order to improve the technical capabilities of the company.
It's been about half a year since I changed jobs to the current company. As I gradually got used to the atmosphere and business of the current company, I gradually began to see the good and bad points of the company.
One of the bad things was, "I don't have much communication between engineers at this company," I thought. Many people speak cheerfully and openly, but basically they don't talk much about technology. There are occasional study sessions, but after work, the participation rate is poor and it is not very efficient in the first place.
So I asked a friend who also works in the Web industry at another company. Me: "What happens to the communication between engineers at company A?" A: "Everyone is selfish, so I'm muttering on my own chat. People who like that are actively participating. I wonder if I'll force people who don't."
I see... This may have been the discomfort of the "study session". After all, if it is a study session, people who do not participate will feel like it is bad, so it is better to feel lighter and do whatever you want.
Then, let's create something like a "room of spirit and time" where engineers can speak freely in the company chat and do not interfere with others. (Our company doesn't ignore the voices of employees who want to do it, and it's not prohibited, so it's good that you can do whatever you want.)
What chat tool do you use at your company? I think there are many famous places as follows.
The image of "Slack" is excellent because the API can be used. You can do more with Slack, but unfortunately our company uses "Chatwork".
The API is also open to the public in "Chatwork", and you can do the minimum with Webhooks. >> Chatwork API documentation
It was okay to launch it in Slack, but I thought it would be easier for the tools already in use to participate, so I decided to proceed as it is.
Well, it's good to make a chat room, but how do you start talking and how do you operate it when you make it? It's good to have a study session chat for engineers in my family before, but at first everyone mutters aggressively, but gradually moves away from the chat, and the last notification is about a year ago.
I don't want to be buried in a company without being used or used. .. ..
So if you let your bot mutter automatically on a regular basis, can you prevent daily notifications and chat rooms from being buried underneath? I thought.
However, Bot also thought that it would be meaningless to mutter meaningless words every day with Bot. What is a meaningful bot ...
Meaningful bot ... Personally, I thought it would be too meaningless to tell me today's date or say hello, but I wanted to think of something useful.
When I searched for my memory there, I remembered writing an article like this on Qiita before.
The above article uses Python's scraping technology to capture the Qiita trends of the day and send them to Slack. I think I should use cron to send this to the room of spirit and time every day.
--Since cron is executed every day even if no one mutters, Qiita's article will be notified to chat ――Notifications come every day, which gives you a chance to see it to kill time. --Since it is an article by Qiita, the chat room becomes a database of knowledge.
I decided to do it.
Since the original program has already been created, all you have to do is change the Webhook part to the writing style for chatwork. See the following articles for details on the program.
Chatwork can easily send notifications to a specific chat room by using {room_id} and an API token given to an individual as follows.
#Send to chatwork
payload = {}
headers = {'X-ChatWorkToken': 'xxxxxxxxx'}
url = 'https://api.chatwork.com/v2/rooms/{room_id}/messages'
payload = {'body': f'{title}[info]\n{message}\n[/info]'}
requests.post(url, headers=headers, data=payload)
Just modify the above program according to the above notation and skip it. When the program is actually executed, it becomes as above.
Make these executions run by cron.
** 1: Create a shell once **
#!/bin/sh
python /Users/ys/Work/get_qiita_article/get_article.py
** 2: Set up cron ** Set to run every morning at 10am (company start time)
$ crontab -e
PYTHONIOENCODING = 'utf-8'
LANG = ja_JP.UTF-8
0 10 * * * cd /Users/ys/Batch/; bash -l -c 'sh get_qiita_article.sh'
Now this program will run every morning and you'll be notified to chatwork.
Volunteers who wanted to absorb knowledge and work hard through discussions gradually gathered if they forced the notifications to be skipped. You have to learn something like "I want to try this", share ideas at development meetings, and so on. I came to talk like this.
As a result, I wonder if success is okay, but personally I feel that I have achieved my purpose, so I wonder if this is okay. Because I don't talk much during work, I can chat like this and gain knowledge, so I can do it with just the right temperature. As I wrote above, even if it doesn't have a role as a chat, just moving the bot can be used as a database of knowledge, so it's fairly useful.
It means "working at a company = working with various people", so it was personally good to have the opportunity to interact in this way. (Because I have only worked for half a year, there are probably some people who don't remember their names and faces.)
Also, I can appeal to the company that I will move if I am a little. It might be interesting for new employees to do it. (maybe)
To tell the truth, I wanted to make it look like this, but it was another story that I couldn't do because of Chatwork specifications. >> Story of creating a VIP channel in in-house slack