Caedes

Desktop Wallpaper, Art, etc.

Discussion Board -> Desktop Wallpaper, Art, etc. -> Automated National Geographic Wallpapers

Automated National Geographic Wallpapers

sathishmls
03/17/04 8:58 AM GMT
For this, u should have IIS or PWS installed.
Create a folder, and take the following contents and save it in a file called Default.asp

// start of file Default.asp
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="CP_ACP"%>
<%
var defaultpicture = false;
var picturepath = "";
var pictureparam = "";
var objSrvHTTP;
var strHTML = "";
var tmpint1 = 0;
var tmpint2 = 0;
var lResolve = 5 * 1000;
var lConnect = 5 * 1000;
var lSend = 15 * 1000;
var lReceive = 15 * 1000;

objSrvHTTP = Server.CreateObject ("MSXML2.ServerXMLHTTP");
try {
objSrvHTTP.setTimeouts(lResolve, lConnect, lSend, lReceive);
objSrvHTTP.open ("GET","http://lava.nationalgeographic.com/pod", false);
objSrvHTTP.send ();
}
catch (e) {
defaultpicture = true;
}

if (!defaultpicture) {
strHTML = String(objSrvHTTP.responseText);
tmpint1 = strHTML.indexOf("/pod/pictures/sm_wallpaper/");
tmpint2 = strHTML.indexOf("/pod/pictures/normal/")-12;
picturepath = "http://lava.nationalgeographic.com" + strHTML.substring(tmpint1, tmpint2);
re = /sm_wallpaper/g;
picturepath = picturepath.replace(re, "lg_wallpaper");
pictureparam = " height=709 width=945";
}
else {
picturepath = "harrypotter.jpg";
pictureparam = "";
}
%>

<html>
<head>
<title>Desktop Wallpaper Grabber</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000000" marginheight="0" marginwidth="0">
< table align="center" bgcolor="#000000" cellpadding="0" cellspacing="0" height="100%" width="100%" border="0" >
< tr align="center" bgcolor="#000000" valign="middle" >
< td align="center" bgcolor="#000000" valign="middle" >
<img src="<%= picturepath %>" align="absmiddle" border="0"<%= pictureparam %>>
< /td >
< /tr >
< /table >
</body>
</html>

<%
objSrvHTTP = null;
Response.End();
%>
// end of file Default.asp

remove the unwanted space in < table >, < /table >, < tr >, < /tr >, < td >, < /td >.
i added it for the text to appear in this forum.
i have optimised this for 1024x768 resolution, and u can customize it for your resolution for adjustment of scrollbars appearing.
now give a alias name for this directory(ex, /grabwp). keep a picture in the name harrypotter.jpg in the same directory.

now in your display properties goto web tab, tick show web content and click New,
and specify your local url to the default.asp file
(ex, http://localhost/grabwp)

Thats it. Finished.
Each day, u will be having a beautiful picture on your Desktop automatically !!!

Try this and enjoy !!! (Thanx to National Geographic Website)

-B.Sathish Kumar, INDIA
0∈ [?]

Comments

Post a Comment  -  Subscribe to this discussion
mckinleysh
03/17/04 3:05 PM GMT
Cool, thanks.
0∈ [?]
On average, half of all false teeth have some form of radioactivity.
*caedes
03/17/04 9:51 PM GMT
Would anyone like to code one of these up to work with caedes.net. I was thinking of doing something like this back when I used windows, but since I've switched to Linux I have since forgotten about it.
0∈ [?]
-caedes

Leave a comment (registration required):

Subject: