In this tutorial you will know how to add Yahoo Weather on your website using jQuery and RSS code, First we will add Html code:

01.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
02.<html>
03. <head>
04. <title>Yahoo Weather!</title>
05. <meta name="Keywords" content="ajax, weather, api, fetch, yahoo">
06.
07. <meta name="Description" content="yahoo, weather">
08.
09.<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
10.
11.<link rel="stylesheet" type="text/css" href="style.css" />
12.
13.<script type="text/javascript">
14.<!--
15./*
16.Credits: Bit Repository
17.URL: http://www.bitrepository.com/web-programming/ajax/show-yahoo-weather.html
18.*/
19.
20.$(document).ready(function(){
21.
22.function get_weather()
23.{
24.var p = $("#code").val();
25.
26.var u = ($(#u).attr(checked)) ? &u=c : ;
27.var to_load = get_weather.php?p=+ p + u;
28.
29.$("#weather").show();
30.
31.$("#weather").html(<img style="margin-top: 104px;" src="ajax-loader.gif" align="absmiddle">);
32.
33.$("#weather").load(to_load);
34.}
35.
36.// Trigger "get_weather" when the window loads
37.$(window).load(get_weather);
38.
39.// Trigger "get_weather" when the form objects are used
40.$("#code").change(get_weather);
41.$("#u").click(get_weather);
42.});
43.
44.//-->
45.
46.</script>
47.
48.</head>
49.
50. <body>
51. <center>
52.
53.<div align="center">
54.
55.<h2 align="center">Yahoo! Weather</h2>
56.
57.<form>
58.Get Weather for: <select id="code" name="code">
59.<option value="USCA1116">Sunnyvale</option>
60.
61.<option value="USNY0996">New York City</option>
62.<option value="FRXX0076">Paris, France</option>
63.<option value="UKXX0085">London, United Kingdom</option>
64.<option value="UKXX0687">Buckingham, United Kingdom</option>
65.
66.<option value="ASXX0001">Adelaide, Australia</option>
67.</select>
68.
69.<input type="checkbox" id="u" name="u" value="c"> with degrees Celsius and other metric units
70.
71.</form>
72.
73.<div id="weather"></div>
74.</div>
75. </center>
76. </body>
77.</html>
Now we will add css code:
01./*
02.Credits: Bit Repository
03.CSS Library: http://www.bitrepository.com/
04.*/
05.
06.html, body
07.{
08.padding: 0;
09.border: 0px none;
10.font-size: 12px;
11.font-family: Verdana;
12.}
13.
14.table
15.{
16.font-size: 12px;
17.font-family: Verdana;
18.}
The last step is to add php code:
01.<?php
02.error_reporting (E_ALL ^ E_NOTICE);
03.
04.if(isSet($_GET[p])) // at least p is required
05.{
06.$p = $_GET[p];
07.
08.$u = isSet($_GET[u]) ? $_GET[u] : ;
09.
10.require( amagpierss/rss_fetch.inc);
11.
12.$url = http://weather.yahooapis.com/forecastrss?p=.$p.&u=.$u;
13.
14.$rss = fetch_rss($url);
15.
16.$title = $rss->items[0][ itle];
17.
18.$description = $rss->items[0][ wouldescription];
19.
20.echo "<br />".$title."<br /><br />".$description."<br />";
21.}
22.?>
19.
20./* Input */
21.input, select, checkbox
22.{
23.margin: 5 5 5 0;
24.padding: 2px;
25.
26.border: 1px solid #999999;
27.border-top-color: #CCCCCC;
28.border-left-color: #CCCCCC;
29.
30.color: #333333;
31.
32.font-size: 13px;
33.-moz-border-radius: 3px;
34.}
35.
36.#weather
37.{
38.border: 1px solid #cccccc;
39.-moz-border-radius: 3px;
40.
41.width: 500px;
42.
43.padding: 5px;
44.
45.height: 240px;
46.}
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.

Original Source: