SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    38911 Basic Bytes Free johnuk's Avatar
    Join Date
    Jul 2008
    Location
    Somerset, England
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Weather Widget & RSS?

    Hi all,

    Im a skilled Javascript / Ajax developer, but ive never had any experience with RSS before.

    I need to produce a weather widget like on this site : -

    http://www.letsvisit.co.uk/

    The javascript of course makes sense to me, but what is going on serverside? E.g., how is the PHP script obtaining UK weather data for the given area/postcode?

    Any help much appreciated!

    Kind regards,

  2. #2
    Non-Member
    Join Date
    Dec 2010
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you use PHP Wheather.Weather is a PHP script to provide weather data for cities around the world.I think it will help you.

  3. #3
    38911 Basic Bytes Free johnuk's Avatar
    Join Date
    Jul 2008
    Location
    Somerset, England
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your input, ive written my own PHP script using Yahoo's RSS weather service.

    The only problem is, weather is returned by Yahoo's location codes e.g. "UKXX1822". But I want my users to search by location name e.g. "London" or post code.

    Can anyone think of a way around this?

  4. #4
    Non-Member
    Join Date
    Dec 2010
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is your code in terms of longitude and latitude?If so you can use Google Geocoder, which supports reverse geocoding returns address_components. You just need to pull out the component of the address tagged with locality and political if you just want the city name. If you want states as well they are tagged with administrative_area_level_1.

  5. #5
    38911 Basic Bytes Free johnuk's Avatar
    Join Date
    Jul 2008
    Location
    Somerset, England
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heya, im not using lat / lng nope. In the end I used two tables, one with the codes & location names, and the other with postcodes. I used some clever joins to link the postcodes to the location codes - seems to work ok.

    Thanks for your input much appreciated

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,449
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    Discussion continued Yahoo Weather RSS feed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •