mercredi 1 juin 2016

Search for an attribute value in a HTML page source [extracted from Firefox browser] and make a windows system alert sound

I am asking to help me with a solution that sifts thru a 'html' code and looks for the value of a specific attribute and that alerts me with a windows notification sound. Let me try and explain what I am doing:

  1. I want to develop a system that will alert me when a messenger contact goes 'online'. In order to do this, I am using Firefox (v 46.0.1) and I open up the messenger's web app window [henceforth called Messenger Window] in Firefox.
  2. I then select a contact and right click to select "Inspect Element (Q)" from the context menu and the following page opens up [see attachment], henceforth called 'Code Window'.
  3. So, in that piece of code, there is a tag [also highlighted in the attachment] that I am interested in.

What I need a code for is to read the whole HTML code and search for the attribute "title" and if its value is "Online", I want my system to beep. But there is also some complication involved I guess - When the contact goes offline [status = invisible], the HTML code does not get refreshed automatically UNLESS, I go to the Messenger Window and come back to the Code Window. So, the possible solution needs to somehow minimize the Code Window and maximize it to fetch the current value of the attribute. This minimize-maximize mechanism needs to happen every 5 secs or so.

Is this doable? This is for my personal use only. I don't intend to make a marketable product out of this. So, I hope there are no legal implications involved.

* Link to the "Code Window" - as referenced in the question *




Aucun commentaire:

Enregistrer un commentaire