Weather Plugin

Discussion corner for Developers of Serendipity.
Post Reply
lamy
Regular
Posts: 32
Joined: Mon Jan 29, 2007 7:51 pm
Location: Paderborn
Contact:

Weather Plugin

Post by lamy »

Hi!

I recently found a php class for the Yahoo! Weather API and decided to create a sidebar plugin with it.

Preview: http://jan.inaustralia.de/

There's still some work to do, some things (Display temperature in Fahrenheit) don't work correctly yet and I have no Idea what to do with thise CVS files...

However, what do you think about it so far?

p.s.: first plugin I try to create :wink:
lamy
Regular
Posts: 32
Joined: Mon Jan 29, 2007 7:51 pm
Location: Paderborn
Contact:

Post by lamy »

So,

here a first version. Should work correctly.

The only things you need are serendipity and php.

http://inaustralia.de/serendipity_plugin_weather.zip
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Works perfectly for me :D Good work.

If you don't mind, I'd like to suggest some modifications:
  • constants should be written in uppercase, I guess ("echo aktuelleswetter" confused me a little at first)
  • leave the default server path empty, or set it to $_SERVER['upload_tmp_dir'], or, even better: $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE (don't know if this actually works, but you should give it a try)
  • add lang includes for UTF-8!!
  • and maybe you can find a way to translate the weather conditions to other languages?
These are only my suggestions, for the next version maybe :wink: Or, you could try to bundle it with our current weather plugin?

- Mattsches
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Weather Plugin

Post by garvinhicking »

Hi!

Looks nice, basically. It doesn't yet show anything more than the current s9y weather plugin, does it?

Maybe you'd like to show your code to us?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lamy
Regular
Posts: 32
Joined: Mon Jan 29, 2007 7:51 pm
Location: Paderborn
Contact:

Post by lamy »

Hi!

No, it doesn't show anything else - but it helps people like me who are not able to install this server plugin you need - my hoster does not allow that, for instance. The whole code is inside the zip file I posted above.

@Mattsches: Thanks for the suggestions! But what has to be inside the UTF-8-Files? I am actually working on a translation right now ;).
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
No, it doesn't show anything else - but it helps people like me who are not able to install this server plugin you need - my hoster does not allow that, for instance. The whole code is inside the zip file I posted above.
You can download the PEAR::Weather file and just put the files into your bundled-libs/ subdirectory of s9y, though. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lamy
Regular
Posts: 32
Joined: Mon Jan 29, 2007 7:51 pm
Location: Paderborn
Contact:

Post by lamy »

Already read about that solution and tried it - but it didn't work =/
lamy
Regular
Posts: 32
Joined: Mon Jan 29, 2007 7:51 pm
Location: Paderborn
Contact:

Post by lamy »

Hm, how can I somehow define arrays as constants?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

About the weather plugin: How did you call your files/directories? If you extracted the Weather directory/files not as

bundled-libs/Services/Weather.php
etc.

then it can't work. But else it should.
lamy wrote:Hm, how can I somehow define arrays as constants?
That's not possible.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lamy
Regular
Posts: 32
Joined: Mon Jan 29, 2007 7:51 pm
Location: Paderborn
Contact:

Post by lamy »

Hm, don't remember that...

However, I think this is the easiest way for me to use my plugin since it is ready to use :D.

Apart from that, it made some fun to create it :twisted: ...


p.s.: thanks ;)
Post Reply