Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Closed Thread
Old 01-01-2004, 04:01 AM Temperature Script
KRYPTOR's Avatar
Skilled Talker

Posts: 62
Name: Ray
Location: Illinois
Trades: 0
I've got a real good question...

Is there a way to write a script
either in java, html, or cgi that a visitor
would goto your webpage and SEE
both THEIR TIME and Temperature
of THEIR location??? Either in
Fahrenheit or Celcius doesn't matter
to me. There was a website I went
to in the past that showed me MY
area weather for that day, the temp,
windspeed, and barometer reading!!!
This was all too cool!!!

If THEY can do it, so can I!

The KRYPTOR
__________________
"What is SEEN is TEMPORAL, What is UNSEEN is ETERNAL".


Please login or register to view this content. Registration is FREE
KRYPTOR is offline
View Public Profile Visit KRYPTOR's homepage!
 
 
Register now for full access!
Old 01-01-2004, 09:54 AM
DaveMo~'s Avatar
Administrator
Defies A Status

Posts: 10,200
Name: Dave
Location: Scott Depot, West Virginia, USA
Trades: 1
I know it's possible since I've had that on personal sites. I don't think it would be a "little" script.

Good luck!

Dave
__________________

Please login or register to view this content. Registration is FREE
:
Please login or register to view this content. Registration is FREE
:
Please login or register to view this content. Registration is FREE
:

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
?

DaveMo~ is offline
View Public Profile
 
Old 01-01-2004, 11:58 AM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
Trades: 0
I think one of the weather sites gives you some code you can put on your pages which displays an image showing the local weather... Not sure which though.
__________________

Please login or register to view this content. Registration is FREE
- Everything a webmaster needs - for free

Please login or register to view this content. Registration is FREE
- Free web hosts reviewed and rated

Please login or register to view this content. Registration is FREE
- Impartial hosting directory - Add your host today for FREE
david is offline
View Public Profile
 
Old 01-01-2004, 01:27 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Trades: 0
The site you saw this code on. Go back and look at their source code and see if theres a credit. Ussualy a script like that was made by some big weather site. And they will have a credit in there. You can then find out the site and get the code for yourself.
__________________

Please login or register to view this content. Registration is FREE
- 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
View Public Profile Visit ACJavascript's homepage!
 
Old 01-01-2004, 04:53 PM Weather SCRIPTS HERE!!!
KRYPTOR's Avatar
Skilled Talker

Posts: 62
Name: Ray
Location: Illinois
Trades: 0
Here are 2 examples of weather scripts.
The second example asks for zip code
input to reaveal your local weather!!!

ENJOY!!!

TEST these out and let me know which
one you prefer!!!!

Example #1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Weather by ZIP (IE 5 Win)</title>
<script type="text/javascript">

var zip = "";

function init()
{
svcElm = document.getElementById("weatherDiv");
svcElm.useService("http://www.vbws.com/services/weatherretriever.asmx?WSDL","Weather");
}

function doGetWeather()
{
svcElm.innerHTML = "Invoking web service..."
zip = document.forms[0].elements["zipCode"].value;
svcElm.Weather.callService("GetWeather", zip);
}

function handleResult()
{
var html = "";
var r = event.result;
if (r.error)
{
html += "A service error occured:\n\n";
html += r.errorDetail.string;
} else
{
var xml = r.raw;
var weather = [];
var fields = [
"LastUpdated",
"IconUrl",
"Conditions",
"CurrentTemp",
"Humidity",
"Barometer",
"BarometerDirection"
];
for (var i=0; i<fields.length; i++)
{
var f = fields[i];
var elm = xml.getElementsByTagName(f).item(0);
weather[fields[i]] = elm.firstChild.nodeValue;
}
html += createHTML(weather);
}
event.srcElement.innerHTML = html;
}

function createHTML(w)
{
var html = "";
html += "<img src=\"" + w.IconUrl + "\" hspace=\"6\" vspace=\"6\" border=\"0\" align=\"right\">";
html += "<p>Weather Update for <b>ZIP " + zip + "</b></p>";
html += "<p class=\"conditions\">Current Temp: " + w.CurrentTemp + "<br>";
html += "Conditions: " + w.Conditions + "<br>";
html += "Humidity: " + w.Humidity + "<br>";
html += "Barometer: " + w.Barometer + " (" + w.BarometerDirection + ")</p>";
html += "<p class=\"updated\">Updated at " + w.LastUpdated + "</p>";

return html;
}
</script>

<style type="text/css">
body {
font-family:verdana, sans serif;
font-size:12px;
}
#weatherDiv {
width:250px;
border:1px solid #aaaaaa;
padding:10px;
}
.updated {
font-size:10px;
}
</style>

</head>
<body onload="init();">
<form action="#">
<p>Enter a ZIP Code<br>
<input type="text" name="zipCode"></p>
<p><input type="button" name="getWeather" value="Get Weather" onclick="doGetWeather();"></p>
</form>
<div id="weatherDiv" style="behavior:url(webservice.htc)" onresult="handleResult()">
Weather results should appear here.
</div>
</body>
</html>

Example #2

<!-- start weather -->
<table border="0" align="center"><tr><td><table border="1" bordercolor="#6C000E" cellspacing="0" cellpadding="4" height="28" width="120"><tr><td width="116" bgcolor="#FFFBEF" height="18"><FORM ACTION="http://www.at57.com/weather/port/weather_port.php" TARGET="_blank" METHOD="GET">
<B><font size="1" face="Arial" color="#6C000E">Check Your Weather</font></b><font face="Arial" color="#6C000E"><FONT FACE="Arial" SIZE="-1"><br></font><FONT FACE="Arial" SIZE="-2">Enter your zip code</font></font><font face="Arial" color="#800000" SIZE="-2">:</font><center> <input type="text" name="zipcode" SIZE=8 MAXLENGTH=5><input type="submit" value="Go"></form><font face="Arial" size="-2"><a href="http://at57.com" target="_blank">AT57.com</a></center></font></td></tr></table></td></tr></table>
<!-- end weather -->


The KRYPTOR
__________________
"What is SEEN is TEMPORAL, What is UNSEEN is ETERNAL".


Please login or register to view this content. Registration is FREE
KRYPTOR is offline
View Public Profile Visit KRYPTOR's homepage!
 
Closed Thread     « Reply to Temperature Script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16650 seconds with 12 queries