IOException.de

Icon

Ausgewählter Nerdkram von Informatikstudenten der Uni Ulm

Simple cURL based activity monitor for websites

I wrote a simple activity monitor to notify me about changes on certain websites. The script is executed as a cronjob on a dedicated server and regularly fetches certain URIs. It then executes diff on the last file fetched from this URI. If there is a difference, it is mailed to me. To describe some use cases:

  • Product in Online-Shop is out of stock, I want to be notified when it is available again.
  • University lecture. Want to be notified when news/exercises/etc are put on the lecture website.
  • Usenet Search. Want to be notified when certain files are available and can be found via a Usenet search site.
  • Event registration. I monitored a Barcamp website to get notified, once the registration was available.
  • Monitor changes on certain Wiki pages.
  • Regularly check if something can be ordered now.
  • Monitor changes to a certain Etherpad instance.
  • Monitor changes on databases. Some projects offer a HTTP API (e.g. OpenStreetMap). Regularly exporting the database file and running diffs against it shows changes.
  • Monitor newly created mailinglists via the lists interface offered by our university.
  • Monitor the delivery status of packages, by fetching the transport providers tracking page.

Generally the idea is simply to monitor content changes on HTTP resources and thus the script can easily be used for anything that supports HTTP. A simple monitor is set-up like this:
./check-for-changes.sh "alice@mail.de" "http://some-resource.net/"

If you want to monitor only a certain part of a website you can use a preprocess file to filter out content you don’t want to monitor:
./check-for-changes.sh "alice@mail.de" "http://some-resource.net/" "./preprocess/only-body.sh"

I have released the project under a MIT license via GitHub.
differenziert.net: Plattform zur Meinungsbildung

Kategorie: unix, web

Tags:

Diese Icons verlinken auf Bookmark Dienste bei denen Nutzer neue Inhalte finden und mit anderen teilen können.
  • MisterWong
  • Y!GG
  • Webnews
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Facebook

2 Kommentare

  1. Simon sagt:

    Der Vollständigkeit halber möcht ich hier noch auf urlwatch[1] hinweisen. Das bietet vor allem hooks für Filterskripte, um z.B. sich ständig verändernde Codeblöcke vor dem diff loszuwerden. Für uulm-Studierende hilft das gegen die cache hashes im JavaScript des uulm-Typo3 ;)

    Aber natürlich nichts gegen DIY! :)

    [1] http://thp.io/2008/urlwatch/

  2. Hey Simon! Danke fuer den Hinweis!

Kommentar