All the self-help gurus keep telling you that you should control your instincts and avoid checking your GitHub projects to see if somebody starred any of them in the last 5 minutes. I have the same problem (yes, first world problems). And as usual, changing the system/environment is easier than changing your own behaviour.
That's why I've changed the way to check for stars counting from a pull to a push approach by using the Xatkit bot development platform.
Now, instead of me checking GitHub for new notifications, I have a bot that alerts me automatically every time somebody stars one of my projects, as you can see in the featured image above. By using our (now extended)
Receive events and perform actions on Github from your Xatkit execution model
Xatkit Github Platform
Receive events and performs action on Github from your Xatkit execution model. This platform is bundled with the Xatkit release.
The Github platform define the following providers:
|GithubWebhookEventProvider||Event||-||Receive webhook events from the Github API and translate them into Xatkit-compatible events.|
||See the platform file||Event sent when a new issue is opened in the repository.|
||See the platform file||Event sent when an issue is edited.|
||See the platform file||Event sent when an issue is closed.|
||See the platform file||Event sent when an issue is reopened.|
||See the platform file||Event sent when an issue is assigned.|
||See the platform file||Event sent when an issue is unassigned.|
||See the platform file||Event sent when|
Basically, we subscribe to the Star_Event and extract out of the JSON Payload sent by GitHub all the data we want to integrate into our message. The reception of the event, the parsing of the JSON data,... is all done by the GithubPlatform.GithubWebhookEventProvider class. We just take what we need from the processed information. As usual, in this example, we post the result on Slack but this is up to you, just make sure you configure the properties file.
Note that the bot can also be the bearer of bad news. If some lesser person decides to unstar your repo you'll get also the proper notification. In both cases, the alert is immediate since we process the GitHub events as they come.
Our Xatkit-GitHub platform is bidirectional. Beyond subscribing to GitHub events we can also call GitHub ourselves to create new issues, add labels, users,... based on a chat conversation taking place on an external platform. We have another example for this: Talk with your repositories – A Slack chatbot for GitHub. See this and other examples in our dedicated xatkit examples repo.
I hope these examples show you how powerful this integration between Xatkit and GitHub can be. Surprise me with your own examples!.
And of course, if you liked it, don't forget to star our repo. You'll made my day if I start getting plenty of star alerts from you!
Releases of Xatkit. Simplest way to build advanced chatbots and digital assistants
What's in the box?
Each release contains two artifacts:
- xatkit_X.Y.Z.zip: the Xatkit runtime bundled with a list of preset platforms. The Xatkit runtime runs your digital assistants, stores logs and monitoring information, and manages your assistant's life-cycle. The list of bundled platforms is available in the release description.
- xatkit-update-site_X.Y.Z.zip: an Eclipse update site containing the Xatkit language editors. The editors allows to define intent libraries, platform specifications, and mix them in complex execution logic that can be executed by the Xatkit runtime.
1- Download the latest release and extract xatkit_3.0.0.zip.
2- Setup the environment variable
xatkit/install-windows.bat with administrative rights
Xatkit Tip: don't waste your time!
This operation is only required…