
It so happens that in our corporate environment, developers use skype group chat for communication. There was a need to notify those present about the ongoing deployment of the code on the production \ testing server.
To do this, a simple python script was written on Flask + SkypeKit and the environment of the
dotCloud cloud service
that is free on such a scale was
set up . The service is taken out of our infrastructure in order to 1) be able to receive error notifications regardless of the state of our servers, and 2) do not put on any proprietary private dirty trick (smile)
SkypeKit is a skype console daemon that allows you to control yourself via python \ c ++ \ java, it has already been
written about in Habré (the instruction may become a little out of date, but there is nothing difficult in the
registration process). Immediately I will make a reservation that to use you will have to pay as much as $ 5 for access to
SkypeKit for Desktop .
So, after you entered
developer.skype.com with your skype account and registered as a developer, and also registered your “application” and got generated for you and your platform (in our case it is
linux-x86-skypekit-novideo ) executables and python SDK versions 3.7.0 (at least that's what I use) - you can begin to configure
skyms .
- Downloading zipball
- In the skypekit / copy directory:
- The generated distribution keypair (* .pem file) as dev.pem (this can be edited in the settings.py file, if you so desire)
- The resulting linux-x86-skypekit-novideo binary
- From the SkypeKit SDK archive files: /ipc/python/skypekit.py and /interfaces/skype/python/Skype.py
- We edit in the skyms / settings.py file the values ​​of the skypeLogin and skypePassword variables in accordance with the account from which we will send notifications
')
Now, having a configured dotCloud account (you can read about it
here ), execute in the application directory:
dotcloud create -f sandbox skyms
dotcloud push skyms
- We are waiting for the right packages to be delivered and the code will unfold.
After that, click on the link that displays at the end of the
push (the first time the page opens for a long time, because it connects and authorizes)
If something does not work (404 on the main page, 499 or some other problem), we look at the service logs with the command
dotcloud logs skyms.www
On the main page of your freshly deployed service, you will see a modest two-field mold. In the first you need to enter ChatBLOB, and in the second - a message that you want to send to chat.
ChatBLOB can be obtained by entering the / get uri command in any skype chat. In response, you (but not the other participants in the conversation) will receive a message from the System:
skype:?chat&blob=
, where XXX will be the chat ID.
In the next article (if you’re interested), I’ll talk about how to incorporate the use of a notification gateway into a capistrano recipe or error page
PS: Of course, it is not necessary to use dotCloud, if you want - you can configure everything differently, but for dotCloud I already have the necessary configuration files in the repository
PPS: By default, there is no access restriction to the gateway, so just in case you should configure http authorization using nginx, since
dotCloud allows it .