DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. A Skype Bot with UNIX Scripting and HTTP Webhooks Integration

A Skype Bot with UNIX Scripting and HTTP Webhooks Integration

Mikko Ohtamaa user avatar by
Mikko Ohtamaa
·
Jan. 01, 13 · Interview
Like (0)
Save
Tweet
Share
9.56K Views

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.

skype lacks good built-in support for external service messages, or robots, sending and receiving automated messages. sevabot, a friendly skypebot , addresses this situation by allowing you to script skype easily, and even remotely, over simple http interface and with any unix scripting language. you can even send skype messages to your group chat directly from a web browser javascript.

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.

2. installation

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.

3. programming

sevabot is written in python . scripting sevabot does not, however, need python knowledge as

  • sevabot modules are normal unix scripts which you can write in bash, python, perl, ruby, javascript, haskel or whatever is your daily drug
  • 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).

in fact sevabot is a middleman between flask web server framework (enables http interface) and skype4py api (control skype gui client with python).

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.

Webhook Integration

Published at DZone with permission of Mikko Ohtamaa, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Top 5 Java REST API Frameworks
  • An Introduction to Data Mesh
  • The Role of Data Governance in Data Strategy: Part II
  • Why It Is Important To Have an Ownership as a DevOps Engineer

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: