Aqua-Soft Forums: [rel] Website Checker - Aqua-Soft Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[rel] Website Checker Rate Topic: -----

#1 User is offline   AndreasV Icon

  • Group: Developers
  • Posts: 2,137
  • Joined: 22-November 03

Posted 04 December 2005 - 02:59 PM

Website Checker
For AveScripter

Screenshot
Posted Image

Description
This desklet checks for updates on a website on a specific interval. When there are changes on the user-configurable site, it'll display a small change-notification.

Graphics by KoL, as usual :)

Shows the usage of asynchronious XMLHTTPRequests to gather and check website without blocking the whole desklet.

Download
http://avedesk.philc.ca/modules/PDdownload...hp?cid=9&lid=38
0

#2 User is offline   SirSmiley Icon

  • Douchebag
  • Group: Member
  • Posts: 1,885
  • Joined: 28-June 05

Posted 04 December 2005 - 03:48 PM

What took you so long? I waited all night for this! :P
0

#3 User is offline   fenixtx22 Icon

  • Group: Member
  • Posts: 298
  • Joined: 15-October 05

Posted 04 December 2005 - 05:29 PM

cool, thanks
0

#4 User is offline   solarsaur Icon

  • Group: Member
  • Posts: 17
  • Joined: 04-May 05

Posted 04 December 2005 - 05:36 PM

Ditto, This blows the socks off of konfabulator.
0

#5 User is offline   Benji Icon

  • Group: Member
  • Posts: 269
  • Joined: 27-August 05

Posted 04 December 2005 - 09:14 PM

This is a little off topic, but where can i get the flip animations and stuff, i have the newest avedesk but i want the flip/suck thingy.
0

#6 User is offline   nightcrawler1089 Icon

  • Group: Administrators
  • Posts: 7,909
  • Joined: 26-February 04

Posted 05 December 2005 - 02:04 AM

Just wondering, how'd you do this technically? The code was a bit confusing...

Thanks ;)
-NC

P.S: I know some about Ajax and Web 2.0, so proceed accordingly :P.
0

#7 User is offline   zondajag Icon

  • Group: Member
  • Posts: 1,399
  • Joined: 26-November 04

Posted 05 December 2005 - 02:08 AM

Um could you add a feature so that when you click on it after the page has changed it takes you to the link....also can you add the 30 second option and also allow font change please?
0

#8 User is offline   AndreasV Icon

  • Group: Developers
  • Posts: 2,137
  • Joined: 22-November 03

Posted 05 December 2005 - 02:17 AM

It's pretty easy:
When the widget is created, an XmlHttpRequest object is created.
function init()

{

	http = new ActiveXObject('Microsoft.XMLHTTP');

	checkSite();

}


The checkSite() function checks the site:
If we are not checking yet, we change the checking indicator to the appropriate image and open a HTTP get operation with the url. Then we 'send' nothing, which means get the contents of the site.
When the status of the requests changes, the onReqDone() function will be called, asynchroniously. That means, this function will not wait for the request to end.
function checkSite()

{

	var url = this.parameters("URL").value;

	var l = this.layers("status");

	if(!isChecking)

	{

		isChecking = true;

		if(l != null)

			l.src = "images/checking.png";



		http.onreadystatechange = onReqDone;

		http.open("GET",url,true);

		http.send("");

	}

}


When the status of the request changes, this function will be executed. readyState holds the status of the request (hardwired to some values). 4 means, totally done
Next, we get the responseText (the url contents) and hash it to compare it the hash of the previous call. If they differ, we assume the site has changed and update the image accordingly.
function onReqDone()

{

	if(4 == http.readyState)

	{

		//var ok = (200 == http.status);

		var oldHash = this.parameters("HASH").value;

		var newHash = hash(http.responseText);

		var changes = newHash != oldHash;

		this.parameters("HASH").value = newHash;



		var l = this.layers("status");

		if(l != null)

		{

			if(!changes)

				l.src = "images/nochanges.png";

			else

				l.src="images/changes.png";

		}



		http = new ActiveXObject('Microsoft.XMLHTTP');

		isChecking = false;

	}

}


A timer then calls the checkSite() function on a regular basis.

What's Web 2.0????? :confused:
0

#9 User is offline   madxcream Icon

  • Group: Member
  • Posts: 10
  • Joined: 24-January 05

Posted 05 December 2005 - 10:07 PM

I tried using this with the site www.betanews.com but it always says there are changes. Is it because of all the advertising on the page?? I just wanted to use it so I knew when something new was posted on there. Thanks for any info.

BTW I used kapsules for a while, and it would use like 60mb of mem, and using avedesk with 6 desklets, it only uses around 3mb. LOL. Great work on this app.
0

#10 User is offline   AndreasV Icon

  • Group: Developers
  • Posts: 2,137
  • Joined: 22-November 03

Posted 05 December 2005 - 10:11 PM

Quote

I tried using this with the site www.betanews.com but it always says there are changes. Is it because of all the advertising on the page?? I just wanted to use it so I knew when something new was posted on there. Thanks for any info.

Yeah, because of the advertising. I also tried checking the headers of the webpages, but most of them return a wrong date anyways.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic