A Skype Bot with UNIX Scripting and HTTP Webhooks Integration
Join the DZone community and get the full member experience.Join For Free
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 community information; we have around five active contributors currently.
Published at DZone with permission of Mikko Ohtamaa, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.