Weather Plugin Enhancement (3 Viewers)

jdiffend

Portal Pro
January 9, 2005
98
0
Joop said:
What I would like to see is the possiblity to specify placeholders in the URLs for year,month,day,hours,minutes and seconds because lots of weather images are having dates in them like the following:
http://www.weeronline.nl/daten/sat/2005/01/26/nlnl0950.jpg?1106733000


Joop

You mean modify the url with tags something like:
%MM% = Month with leading zero if needed
%DD% = Day with leading zero if needed
%YY% = Year with just the last 2 digits
%DAY=#% = Day of the week cut to # digits
%MONTH=#% = Month as text limited to # digits
%YEAR% = Year as 4 digits

So your url would be something like:
http://www.weeronline.nl/daten/%DAY=3%/%YEAR%/%MM%/%DD%/nlnl0950.jpg

Which would be cool (and not super tough since you are just doing a search and replace) just as long as the image name doesn't change. I suppose it might have a time code as well but you could use tags for the time as well.

The numbers wouldn't present a problem but the abbreviations might. You'd probably have to be able to modify those in an XML file or database and be able to insert an ID or KEY into the string so it knows which one to use. That might be easier for multiple languages.
 
P

paulh

Guest
I’m currently working on a few more enhancements for this plugin and think the idea of using placeholders or tags to build up the URL is a really good idea. I’ll drop another post on this thread once I’ve got something worth showing.
 

jdiffend

Portal Pro
January 9, 2005
98
0
paulh said:
I’m currently working on a few more enhancements for this plugin and think the idea of using placeholders or tags to build up the URL is a really good idea. I’ll drop another post on this thread once I’ve got something worth showing.
I use a download manager that does something like this. From the Getright download manager's daily download feature (so you aren't starting from scratch):

Special Values

Within the URL and file names ... you can use special values that GetRight will replace with the current date and time information. You may use these values anywhere in the path or file name.


%YY% Current year (2 digits--so 99 or 00)
%YYYY% Current year (4 digits--so 1999 or 2000)

%MM% Current Month (2 digits--'0' added if needed.)
%-M% Current Month (1 or 2 digits--no '0' added.)
%MON% Current Month (3 letter abbreviation..."apr"...always lowercase.)
%MONTH% Current Month (spelled out; December, etc.)

%D% Current Day (2 digits--'0' added if needed.)
%-D% Current Day (1 or 2 digits--no '0' added.)

%DAY% Current day of the week (spelled out; Monday, Tuesday, etc.)

%H% Current Hour (2 digits--'0' added if needed, 24-hour format)
%-H% Current Hour (1 or 2 digits--no '0' added, 24-hour format)

%M% Current Minute (2 digits) This is NOT guaranteed to be exactly the same minute of the time you set the download to be added.

%J% Days since the beginning of the year. (3 digits--'0' added if needed.)
%-J% Days since the beginning of the year. (not padded to 3 digits--no '0's added.)

%W% Week of the year (2 digits--'0' added if needed. 00 to 51)
%-W% Week of the year (1 or 2 digits--no '0' added. 00 to 51)


%N% An incrementing number to make the file name unique, first file 001, second file 002, etc. Does max out at 999.

%DATE-X%

%DATE+X% Lets you do a little math on the dates. Moves the date back (-) or forward (+) in time X number of days for doing the other replacements. This will work if going back X days means a different month or year. These can be anywhere in the value, they will be removed from the result.

And some Extra special values, not related to dates, but extra functions you can do or switches to turn on.

%ENV-xxx% Reads any Windows environment variables to include. The ones you might want most are %ENV-USERNAME% or %ENV-USERPROFILE%

Examples:

The filename value of:
c:\my-stocks\prices_%YYYY%-%MM%-%D%.html

On April 15th, 2000, would have saved to filename:
c:\my-stocks\prices_2000-04-15.html

Using the math

c:\my-stocks\prices%DATE-10%_%YYYY%-%MM%-%D%.html

On April 15th, 2000, would have subtracted 10 days from the date and saved to filename:

c:\my-stocks\prices_2000-04-5.html
 

gds

Portal Pro
October 4, 2004
53
0
Italy
What can I say? The plugin already looked good to me, but now it sure looks better and has more useful options.
I've got just two things to add:
1 - the translation: as soon as the new version of MP with your plugin is out, I'll do my homeworks (meaning the italian translation, as usual).
2 - the layout: I'd prefer the Weather channel logo to be left aligned with the button, right now it seems out of place to me.
GDS
 
X

X4

Guest
I think we should have a poll to see how many people make a transperent PNG for it... :lol:
 
A

Anonymous

Guest
This is very good work. Congratulations!

Here are some ideas for additional information.

Pull record highs and low temperatures, what is the normal temperature for the day, and what was the temperature one year ago?

I think this information can be scraped from weather underground.
 
N

N_Sheehan

Guest
Is this required or supported in 1.0.8?

I applied the changes just to see what happens and it buggered things up pretty good. Got a KMODE_EXCEPTION_ERROR, exception not handled (get a number of these), the error handling code in MP seems a bit light ;) kinda like the 'help files'

I wish I had the programing skills to help on this project. It's IMHO about 75% of the way to being a useable product, and by that I mean something that anyone could use. Right now it's like Linux, great, lots of potential, but not ready for Mom and Dad if you know what I mean.

Thanks to everyone contributing to this project, I'm gonna figure out the ID10T errors on my end sooner or later!

Cheers.
 
P

paulh

Guest
You shouldn't need to apply any changes as this enhancement has been included in the standard setup since 0.1.0.6
 
A

Anonymous

Guest
would it be possible to use wunderground.com for the weather data, since that includes alot more places on earth...or even METAR data, as I live close to a military airport with darn accurate weather data ;-)

Ps i did a search, but only found info on adding satelite pics, not weather data from wundergound.com

any clues are welcome :)

Thanks
 

mPod

Portal Pro
January 26, 2005
2,084
3
Berlin
Home Country
Germany Germany
Jester said:
would it be possible to use wunderground.com ...or even METAR data
That does not work at the moment, because the weather is grabbed and distilled from the website of weather.com. Other sites would need other grabbers, that means different code to distil. If you want it, you could post this concern in the "Feature Request" section, maybe it will be implemented in some future.
 

Users who are viewing this thread

Top Bottom