A Skype Bot with UNIX Scripting and HTTP Webhooks Integration
Skype is the most popular IM client with over 200 million monthly users. It’s easy and reliable: anyone can use it anywhere, even on mobile. When you are working with virtual teams, Skype group chats become vital tool of communication.
Sevabot loves you.
1. Use cases
Sevabot is geared to be an AI support person for a virtual development and operations teams.
- Receive development status information to Skype chat (continuous integration like Jenkins, Travis, Github and Subversion commits)
- Get operational alerts like overloaded servers, service down (e.g. Zabbix monitoring alerts)
- Add your own group chat commands to make Sevabot perform automatized tasks for you (you can write scripts in *any* UNIX supported programming language)
The scope of Sevabot does not need to be limited to software development: You could, e.g., make Sevabot interact with Google Docs or Salesforce.
Sevabot can be run on Linux server, Linux desktop and OSX desktop. Due to how Skype is built you need to run a Skype GUI client inside a virtual X server to deploy Skype on a production server. Vagrant automatized server configuration is supported for automatically creating and deploying a virtual machine running Sevabot.
Sevabot can be run Windows, in theory, but the authors have not had inspiration to explore this cunning option.
Sevabot is written in Python. Scripting Sevabot does not, however, need Python knowledge as
- External services call Sevabot over HTTP webhooks and any programming language can do HTTP requets
You can even script Sevabot without programming knowledge, as there exist HTTP webhook middleman services like Zapier, which allow you to connect event sources (e..g Github API) and sinks (Sevabot HTTP interface).
Here is a simple example how to send a message to a Skype chat from a Bash shell script. It’s a Subversion post-commit hook which displays the commit message in a specific Skype group chat (full example):
#!/bin/bash repo="$1" rev="$2" svnlook="/usr/bin/svnlook" # Get last commit author author=`$svnlook author $repo` # Get last commit message commit_message=`$svnlook log $repo` # List of changed files changed=`$svnlook changed $repo` # Chat id chat="YOUR-CHAT-ID-HERE" # Sevabot endpoint informaiton # Shared secret secret="YOUR-SHARED-SECRET-HERE" msgaddress="http://YOURSERVER.COM:5000/msg/" # Create chat message msg="★ $author - $commit_message $changed" # Sign the message with MD5 md5=`echo -n "$chat$msg$secret" | md5sum` #md5sum command prints a '-' to the end. Let's get rid of that. for m in $md5; do break done # Call Sevabot's HTTP interface curl $msgaddress --data-urlencode chat="$chat" --data-urlencode msg="$msg" --data-urlencode md5="$m" exit 0
4. You want it – come for us
Go to Sevabot Github project page for more information. Also check the communityinformation; we have around five active contributors currently.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)