Spaghetti and Hammers

Lighthouse keeper - yet another ping

Lighthouse keeper - yet another ping

July 26, 2015 | 4 Minute Read

It has been a while since my last post, but between some side projects, summer vacation, and personal hobbies, it hasn’t been exactly easy to get time to write something.

Today I want to talk about another small project I finished not long time ago!

GYC2015

It all started at Go Youth Conference 2015 (or GYC 2015) last April. GYC is an unique conference, created by a group of young entrepreneurs in 2012, with one clear goal, to inspire and empower young people to create their own future. Where entrepreneurs can exchange ideas, start meaningful conversations and be introduced to powerful content that can help them to thrive and take charge of their economic future. This year edition presented us an excellent line-up, containing speakers such as:

Yo

And what really made this project happen was the talk by Or Arbel. In his talk he introduced Yo. Do you remember Yo?</br> Yo is a mobile app launched a little more than a year ago (early 2014). It made a huge impact: first it seemed the next big thing, the next social network. Then, it seemed the most pathetic mobile app someone ever did. It had a single functionality: send a ‘yo’ (a notification, a Snapchat without image, video, text, or any other thing) to someone else - currently it is possible to incorporate links, images, and GPS coordinates. Business Insider and Entrepreneur wrote some interesting articles about Yo, just check them !

But Or Arbel made me (and probably everybody in the audience) see the true power of Yo: Yo could replace those 5 seconds calls just to say “Hey man, I’m already at your door to pick you up, just hurry up”, or “Hey mom, I’m leaving school now. I’ll arrive home in 10 minutes”. Even better, it could work as a notification for some service, like a blog. The blog owner (or any automated mechanism) would send a Yo to all its subscribers and they would know a new post had just been released. Well, everything seems nice, but I could use my RSS reader for that, or making a simple (probably free) phone call to my friends and mom…

But that’s not the truly power of Yo: Yo is a notification infrastructure that only requires a publisher, and some subscribers. The most powerful example Or Arbel gave us was from a conflict country (I think is Iraq, but not sure) which wanted to implemented a civilian notification channel for missile alert for years, and using Yo it was able to implement it with almost no effort and in very little time.

During his talk, Or Arbel told us about Yo API, and that it would have great new features in the coming months, so I decided to take a look at Yo API. Well, it was simple, and it would be fun to play a bit with it. But what could I do with Yo API? The first idea that crossed my mind was a small python script that would check if a specified URL is responding. If not, it would notify someone (possibly the owner/manager) through Yo. And so was born lighthouse-keeper !

lighthouse-keeper repository

Lighthouse-keeper reads several properties from a configuration file:

  • URL that should be checked
  • ping definitions (time between each ping request, maximum of errors before notifying, and connection timeout)
  • yo definitions (api token, notifiers, and an optional link to be send in the yo notification)
  • email definitions, if you want to notify by email also (server, account, password, recipients, email subject, email body)

It is a very simple project, one that can be done easily in a weekend, used just to play with Yo API. It is not error safe, many error cases are not being checked. So, if you plan to use it, you’ll probably have to test it a bit and make some fixes.

Feel free to take a look in github.

If you enjoyed my work, consider supporting it bellow with a small donation.
Buy Me A Coffee

Newsletter

Did you enjoy this blog post? Sign up for my Newsletter to be notified of new posts. (Pretty low-volume, around once per month.)