To be alerted if no more tweet is sent from your Twitter account: Twitterwatch

This version 0.1 of Twitterwatch is dedicated to Ian Murdock, Debian project Founder.

If you use an automated system like Feed2tweet in order to feed your Twitter account from your website of any RSS feed, it is of the utmost important to know when this system is broken, because you are losing traffic because of this malfunction.

At the Journal du hacker, a French-speaking FOSS website where people contribute weblinks like Hacker News or Lobste.rs, every new contribution is sent through the RSS feed to the Twitter account of the Journal du hacker. A lot of our readers only follow the news on Twitter. So if the link breaks, our readers are not fed any more 🙂

To be alerted to this issue, I wrote a small self hosted and documented app. I’m proud to introduce Twitterwatch !

It runs with Python 3.4 and the Tweepy library. You can install it from PyPI or from sources. The documentation is available on Readthedocs. You can read about how to install it, configure it and use it. It’s the first release but the main features do the job already.

In order to use it, you need a twitterwatch.ini file as following:

[twitter]
consumer_key=ml6jaiBnf3pkU9uIrKNIxAr3o
consumer_secret=4Cmljklzerkhfer4hlj3ljl2hfvc123rezrfsdatpokaelzerp
access_token=213416790-jgJnrJG5gz132nzerl5zerwi1ahmnwkfJFN9nr2j
access_token_secret=WjanlPgqDKlunJ4Knr11k2bnfk3jfnwkFjeriFZERj16Z
[schedule]
; duration between 2 checks in minutes
check_interval=60
[mail]
host=localhost
from=admin@myserver.org
to=foo@mylaptop.org

The most difficult part is now complete. To launch Twitterwatch, just launch the following command:

$ twitterwatch /path/to/twitterwatch.ini

Whenever no more new tweet is sent from your Twitter account  during 60 minutes,  you’ll receive the following mail (here the user is @journalduhacker):

Title: Twitter stream of journalduhacker has stopped

Body: Twitter stream of journalduhacker has stopped since 23/12/2015 - 14:49:23

It is still pretty rough, but it does the job. New features will come whenever I need them (or if you require/open bugs/submit push requests 😉 ). Write a comment to tell me what you think of it or why you use it!

Publicités

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s