skypekit

Libskypekit and Skypekit – C and Ruby interface for Skype

| 6 Comments

Preface

There are two methods to programmatically use Skype:

The first method is rather slow due to an interaction with the user interface. The second one is more interesting as there is no UI application.

SkypeKit SDK includes only wrappers for:

  • C++
  • Python
  • Java

Is Ruby wrapper missed? No more!

On the way to gem

Before releasing gem, we tried several approaches. We tried to implement SkypeKit in pure Ruby as it done in SkypeKit Python Wrapper. But then, we realized that even if we make do it, its implementation will not be as fast as it should be. Then, we started to write a C extension for Ruby using the SkypeKit C++ Wrapper. But then, we admitted that this implementation will be inefficient due to asynchronous SkypeKit API and pure Ruby thread. Finally, we came to the implementation via Ruby FFI. We think that it’s the best way to do it because:

  • Thread stuff are completely on C side.
  • Synchronous program is easy to debug an test.
  • SkypeKit gem works in Ruby.
  • SkypeKit gem works in jRuby!
  • It’s possible to quickly implement SkypeKit in Perl/Python/lua/etc.

SkypeKit C library

Libskypekit is a simple C library that brings asynchronous SkypeKit C++ wrapper functionality to the usual synchronous C applications.

The goal of Libskypekit is to catch all asynchronous callbacks of SkypeKit C++ SDK and push them as events into a simple queue. Then synchronous application can pull this queue, retrieve each event and process it.

Libskypekit is rather a young library, but we have already implemented the next basic events:

  • Account status changed
  • Chat message received

It’s enough to write simple chat applications. If your are familiar with C language look at ping_pong example

Is Ruby wrapper still missed? No more! :)

Skypekit Ruby gem

Thus LibskypeKit has a simple API, it’s was relatively easy to create a Ruby library using Ruby FFI.

Plus the Skypekit Ruby library provides a simple interface. For example, look at ping_pong example:

I want try it

In order to play with SkypeKit gem you need:

  • Register at developer.skype.com
  • Obtain SkypeKit SDK
  • Obtain SkypeKit Runtime
  • Obtain SkypeKit personal keypair

Then:

  • Compile SkypeKit SDK – see SDK documentation
  • Compile LibSkypeKit – see README in repository
  • Install SkypeKit gem – see README in repository

Now you can play with it.

Legal part

Libskypekit and Skypekit gem are both released under the MIT license.

But SkypeKit SDK is not!

Please carefully read SkypeKit License Agreement.

There are a lot of restrictions!

References

Share
* Railsware is a premium software development consulting company, focused on delivering great web and mobile applications. Learn more about us.

Want to get more of Railsware blog?

RSS FEED

We're always ready to help!

CONTACT US