Mickaël Andrieu


TweetHub, the missing GitHub release notifier on Twitter!

How many times did you receive an issue about a bug already fixed in a new release?

How many times your customers fix a bug on their side when they could enjoy the latest version with official bug fixes and new features?

Discussing with some Akeneo developers, they asked me: “How can we know when a new release of <amazing-Akeneo-package> is published?”.

It’s pretty simple, as GitHub dispatch events for every action done into a repository or an organization.. so I’ve built a minimalist bot in 2 hours that provide the feature for free, because I love open source you know :)

TweetHub logo

Tell me more!

Sure, you need to get the archive from releases page and an environment that supports PHP with Composer installed: you won’t have to know PHP.

Then install dependencies using Composer: composer install, this will create a vendor folder and configure the class autoloader.

Then copy/paste the distributed .env.dist file and fill it with Twitter credentials (to get credentials, you have to register a new application on Twitter).

Finally, host the PHP script on any server that allows a public access from outside (for instance on Heroku), and register the GitHub webhook:

Protip: select only “Release” events to not spam your PHP script for nothing
And here you go! Amazing, right?

What’s the f*ck is this @ expression in your Twitter message?

Well, the MicroEngine class I’ve created allows the access to every data contained by the Release object from GitHub API (you only need to use Camel case instead of Snake case). You can find the list of available properties in the PHP project I use to map GitHub Json responses to a developer-readable Release object.

In my case, @htmlUrl retrieves the html_url property from GitHub release, i.e the release HTML page url!

I want to contribute!

Please don’t. For real I don’t have too much time to spend on this kind of baby project, I encourage you to fork it and have fun with it like I had :)

Happy coding everyone!

PS: If you have something to share, feel free to do it here, on GitHub or Twitter ;)

More by Mickaël Andrieu

Topics of interest

More Related Stories