Forum Moderators: phranque
Do two things though:
(1) DON'T do it in real-time - have it run every once in a while and store the data locally so you don't waste their bandwidth, and
(2) Give them credit for providing you with the info.
If you were to visit that site in your web browser, look at the temperature, and update your own database with whatever that number was, you're not stealing copyright-protected material - you're just copying down the current temperature.
If you write a program that does essentially the same thing, no laws have been broken. Your program is visiting their site, looking at the temperature, and updating your database.
Weather.ca (TheWeatherNetwork.com) has a little desktop program to show weather updates in the tray. I used socket spying program and identified the way they get the weather data into the program. They have a separate server for XML output of the weather.
The only thing is, each Canadian city is represented as an integer. If need it for one city - it is fairly easy. Just choose that city from the list in the program and look into socket communication - you will see the ID of city in the query to the script, then you could just do the same query, parse XML and have the weather for that city. If you want the weather for all the cities, it will be rather difficult, as you would have to check the ID of each city to find out it's name.
And no, the XML does not return the name of the city, so you would not be able to just run a query from 1 to N IDs and get all the city names. It does return airport code though...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<title></title>
<style type="text/css" media="screen">
body {
padding: 0;
margin: 0;
}
#weather {
width: 200px;
padding: 10px;
float: right;
font-size: 12px;
}
#weather a {
color: black;
}
#weather a:hover {
color: #708090;
}
</style>
<script type="text/javascript" language="javascript">
function get_weather() {
var address = "http://weathereye5.mmtwn.pelmorex.com/PTiWeatherEye/WeatherEye.dll/GetPlaceData?PlaceCode=[b]CAON0512[/b]&UserId=200000&Version=1.0.0.2&PVersion=9&firstCon=0";
var xmlDoc;
var moz = (typeof document.implementation!= 'undefined') && (typeof
document.implementation.createDocument!= 'undefined');
var ie = (typeof window.ActiveXObject!= 'undefined');
if (moz) {
xmlDoc = document.implementation.createDocument("", "", null)
xmlDoc.onload = readXML;
} else if (ie) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
while(xmlDoc.readyState!= 4) {};
}
xmlDoc.load(address);
var data = xmlDoc.getElementsByTagName("data");
var ObsDescriptionEn = data[0].getElementsByTagName("ObsDescriptionEn");
var ObsTemp = data[0].getElementsByTagName("ObsTemp");
var ObsDate = data[0].getElementsByTagName("ObsDate");
var ObsWdir = data[0].getElementsByTagName("ObsWdir");
var ObsWSpeed = data[0].getElementsByTagName("ObsWSpeed");
var ObsHumid = data[0].getElementsByTagName("ObsHumid");
var ObsPress = data[0].getElementsByTagName("ObsPress");
var weather = '';
// temperature
weather += "<b>Temp:</b> ";
weather += ObsTemp[0].firstChild.nodeValue;
weather += "°C<br />";
// Condition
weather += "<b>Condition:</b> ";
weather += ObsDescriptionEn[0].firstChild.nodeValue;
weather += "<br />";
// Wind
weather += "<b>Wind:</b> ";
weather += ObsWdir[0].firstChild.nodeValue;
weather += " ";
weather += ObsWSpeed[0].firstChild.nodeValue;
weather += " km/h<br />";
// Humidity
weather += "<b>Humidity:</b> ";
weather += ObsHumid[0].firstChild.nodeValue;
weather += "%<br />";
// Pressure
weather += "<b>Pressure:</b> ";
weather += ObsPress[0].firstChild.nodeValue;
weather += " kPa<br />";
// Updated
weather += "<b><a title=\"Click to update data\" href=\"\" onclick=\"write_it(get_weather(), 'weather'); return false;\">Updated</a>:</b> ";
weather += ObsDate[0].firstChild.nodeValue;
weather += "<br />";
return weather;
}
function write_it(text,id)
{
var x;
var text2;
if (document.getElementById)
{
x = document.getElementById(id);
x.innerHTML = '';
x.innerHTML = text;
}
else if (document.all)
{
x = document.all[id];
x.innerHTML = text;
}
else if (document.layers)
{
x = document.layers[id];
text2 = '<P CLASS="testclass">' + text + '</P>';
x.document.open();
x.document.write(text2);
x.document.close();
}
}
</script>
</head>
<body onload="write_it(get_weather(), 'weather'); setInterval('write_it(get_weather(), \'weather\')', 1000*60*60)">
<div id="container">
<div id="weather"></div>
</div>
</body>
</html>
I though know that it is not really ethical to do that kind of thing, but then again, I only do it for personal use, I don't include that into my website, I just have it on my desktop, I don't like their software they use. It takes 8mb of memory just to show temperature...
In this particular case it wouldn't be illegal because you're simply automating a task that you could otherwise do manually.
Hold your horses there - that's the lamest excuse I've ever heard! That's like saying that I can automatically scrape content from your site and publish it on mine because people can just read it on your site anyhow.
Be careful with this sort of stuff - I've licensed weather information for a good few sites, including content from Weather.com - and you do need to at least approach them!
On the other hand, there are Govt services around the world that do give out free data. The US weather service (NOAA) does give out free forecasts for usage. You can use HamWeather to pull the data off the Noaa server legally. (I don't know ofanything like that in canada)
How you retrieve it doesn't matter. There are no laws against this. Some may consider it "unethical" to do it without asking, but it is NOT illegal.
The *fact* about the weather isn't what's proprietary BUT the other party's presentation of it certainly is. You cannot just take someone's presentation off their site without their permission. Scraping a site to take what they've put on is taking their presentation and it's not only unethical but if they complain it can have disastrous consequences.
We are not attorneys here, the safest bet is to pursue legal counsel to know for an absolute 100% fact. I for one sure don't want anyone telling me absolutely that something is legal and fine that may not be. If they're wrong I'm left holding the bag - not the person who gave the incorrect information.
The safe way to proceed when something is questionable: when it doubt, leave it out.
If you need it in French, try [meteomedia.com...] or in English, [theweathernetwork.com...] (both the same company). Might be just what you need.
Scraping a site to take what they've put on is taking their presentation and it's not only unethical but if they complain it can have disastrous consequences.
I'm having trouble understanding what part of this you think is wrong. If you were to visit their site in your browser and copy/paste the information into your database so it could be displayed on your own site you're not doing anything wrong. In fact, I don't know of any news source that would even mind - Especially if you went so far as to give them credit for being the "source" of the info.
Doing this is not illegal, unethical, immoral, etc. What I'm having trouble understanding is why you seem to think it magically "becomes" illegal when you write a program to automate what you would otherwise be doing manually. It's not illegal by any means. You're not stealing the radar charts or anything like that, you're taking uncopyrighted PUBLIC INFORMATION. The method you retrieve it makes no difference.
[edited by: rogerd at 4:49 pm (utc) on June 14, 2004]
[edit reason] Fixed link [/edit]
Hey digitalv, how about entering into a contract with those who want to take your advice whereby you will agree to pay any legal fees they might incur as a result of taking such advice.
Fine with me ... I'm not sure about Canada's laws, but in the US weather is a public service provided by the National Weather Service and funded by the U.S. Government. You are not guilty of any crime if you post the weather on your site regardless of whether you get it there by typing it manually or automating it.
Exactly. 100% correct - and any web page put up by the US Government is considered to be in the public domain, therefore not protected by copyright law. Not so with any privately owned entity - they are not supported by taxpayers funds.
Lighten up and enjoy life dude, it's OK to be wrong. It happens to even those of us who are exceedingly brilliant. ;)
Now you're cooking with gas! If there's gonna possibly be any problem, might as well go for the big time and tangle with the Feds. ;)
Another option is that real estate sites often show weather and some get it from commercial sites that let them use it for nothing more than a link back and branding. So those sites get loads of inbound links with anchor text, and then they can sell Page Rank.
Interesting business, isn't it?
...in Canada for absolute sure.... Any information made freely available on the internet (ie. not protected by usernames or passwords or other authorization schemes) is equivalent to a freely published work, and any published work is subject to fair use (ie... quoting of various parts of it) as long as that use is not substantial duplication without credit fairly given.
Copyright notices posted on the internet mean precisely nothing, exactly the same as the so-called "poor man's copyright", unless the associated content is indeed properly copyrighted through a copyright office or other legal entity.
IANACIPA I Am Not A Canadian Intellectual Property Attorney
[laws.justice.gc.ca...]
There seems to be a lot of law preserving the rights of publishers and broadcasters.
Are you sure about that? Admittedly I just skimmed this stuff, but I saw enough there to make think that it is protected at the moment of creation.