Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Putting basic weather info on a commercial website

Featured Replies

Hi all,

 

I'm trying to find out how to get basic weather information on a commercial website my company is building.

 

All we want is something that displays a weather symbol (sun, cloud, rain etc.) and the high and low temps. However, it does need to be unbranded so the free widgets out there are out (plus they generally can't be used on commercial sites anyway).

 

I realise we will most likey need to pay for an unbranded weather service but does anyone know of one that is relatively inexpensive?

 

Thanks.

http://www.yourweather.co.uk/resources_free_to_webmaster-London-Europe-United+Kingdom-London--1-34032.html?gclid=CO-it-KB16MCFUj-2AodhntDuQ

 

Here's a link to a completely free weather widget that maybe of some use. Admittedly not the best looking one I've seen, but it may help you out :)

 

p.s This does offer the high and low temps you asked for, but at the moment those options are grayed out [assuming they're asking you to sign up to the site or pay a small fee for those features I'm not sure] But like I say it maybe useful, even if it is just a temp until you find a better service.

There are free API's available from weatherbug and wunderground. Also the iGoogle weather gadget uses XML which you can query, here is an example...

 

<?php
$ch = curl_init("www.google.com/ig/api?weather=Linlithgow,Scotland");

curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2. Gecko/20100723 Linux Mint/8 (Helena) Firefox/3.6.8");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$output = curl_exec($ch);      
curl_close($ch);

$xml = simplexml_load_string($output);

echo '<img src="http://img0.gmodules.com/'.$xml->weather->current_conditions->icon['data'].'" /><br/>';
echo $xml->weather->current_conditions->condition['data'] . ' '; 
echo $xml->weather->current_conditions->temp_c['data'].'°C<br/>';

?>

 

Assuming you have PHP5 + CURL.

  • Author

Thanks for the help guys, particulary Jock as that iGoogle weather gadget could be just the ticket. I will investigate and see what I can get out of it.

 

Cheers.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.