Yahoo Weather Plug-In

Discussion corner for Developers of Serendipity.
Post Reply
doomsayer
Regular
Posts: 14
Joined: Thu May 12, 2005 9:05 pm
Location: Wisconsin
Contact:

Yahoo Weather Plug-In

Post by doomsayer »

I tried to create a Yahoo Weather plug-in.
You can see it at http://www.wesandkim.com/blog
The code is at http://www.wesandkim.com/blog/serendipi ... eather.zip
It allows you to put in up to 15 different locations you'd like to see the weather for. The configuration allow you to switch between Celsius and Fahrenheit.
Because of the way I parsed the RSS feed from Yahoo it requires php5.

This is my first plug-in so be gentle.
:D


I noticed Iamyposted about creating one also, however I don't see the code for it anywhere.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Nice job! I haven't checked the source, but the implementation is working nicely. Congratulations; I look forward to seeing the rest of your efforts.
Judebert
---
Website | Wishlist | PayPal
xqTpx
Regular
Posts: 25
Joined: Wed Oct 11, 2006 6:29 pm

Post by xqTpx »

I'm loving your plugin, its working just after the installation. No requierd perl or anything else :). I'm not quite sure how i can costumise that plugin to display the weather condition in german .....
but that shouldt be a problem.

btw: lol ^^
@define('PLUGIN_YWEATHER_DEFAULTZIP_BLAHBLAH',
doomsayer
Regular
Posts: 14
Joined: Thu May 12, 2005 9:05 pm
Location: Wisconsin
Contact:

Yahoo weather Plugin

Post by doomsayer »

I am glad you like it. I would love to get it to work in German. If you can help me find a German rss feed for it. http://de.weather.yahoo.com/ would be the place to start looking I think.

You can have it work for anywhere in the world by figuring out the location code for anyplace and of course switching from degrees in F to C.
doomsayer
Regular
Posts: 14
Joined: Thu May 12, 2005 9:05 pm
Location: Wisconsin
Contact:

Yahoo Pipes to translate

Post by doomsayer »

Yahoo Pipes can translate a RSS feed into German using Bablefish. Since I don't speak enough German to do more than order a beer I have no idea if it translates well enough.

If it does it may be a good solution.

http://pipes.yahoo.com/pipes/pipe.info? ... jalkl7okhQ
sonichouse
Regular
Posts: 196
Joined: Sun May 11, 2008 2:53 am
Contact:

Post by sonichouse »

This works fine for me.

I had to comment out the cookie on line 313

Code: Select all

    // Set the cookie for the browser's session's life.
//    setcookie('yweather',$weather); 
as Cherokee was moaning about the headers already being sent.

Perhaps we can have the cookie as a config option ?

Thank you for taking the time to contribute this.
sonichouse
Regular
Posts: 196
Joined: Sun May 11, 2008 2:53 am
Contact:

Post by sonichouse »

There was a missing /select at the end which caused Safari to barf.

So i changed it to do

Code: Select all

echo "</select><br /><input type =\"submit\" value =\"Submit\" /></form>";
Cheers.
doomsayer
Regular
Posts: 14
Joined: Thu May 12, 2005 9:05 pm
Location: Wisconsin
Contact:

Version 1.1 enhancements/bugfixes

Post by doomsayer »

Version 1.1 enhancements/bugfixes
  • Replaced the Submit button with javascript to submit the page.
    Should no longer have the "drop down list has a blank line at the bottom that causes an error if you select it".
    Added a closing </select> to fix a reported Safari error.
Thanks to sonichouse for catching bugs.
Post Reply