It is currently May 3rd, 2024, 2:43 pm

Quick Question - Inserting the current date into a URL

Get help with creating, editing & fixing problems with skins
User avatar
NamesTwister
Posts: 7
Joined: July 29th, 2011, 1:31 am
Location: USA

Quick Question - Inserting the current date into a URL

Post by NamesTwister »

It's for a google calendar reader. I want to insert the current date, and the current date+1 into the URL.

Code: Select all

[mGcal]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=1800
Url=#gcalURL#?start-min=#currentDate#&start-max=#tomorrow#&singleevents=true&orderby=starttime&sortorder=a
RegExp="(?siU)<email>#GET##GET##GET##GET##GET##GET##GET##GET#"
The variables in the code are #currentDate# and #tomorrow#
I can't figure out how to bind the current date to variable to use it in the URL.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Quick Question - Inserting the current date into a URL

Post by jsmorley »

NamesTwister wrote:It's for a google calendar reader. I want to insert the current date, and the current date+1 into the URL.

Code: Select all

[mGcal]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=1800
Url=#gcalURL#?start-min=#currentDate#&start-max=#tomorrow#&singleevents=true&orderby=starttime&sortorder=a
RegExp="(?siU)<email>#GET##GET##GET##GET##GET##GET##GET##GET#"
The variables in the code are #currentDate# and #tomorrow#
I can't figure out how to bind the current date to variable to use it in the URL.
That you really can't do, as WebParser can't use Dynamic Variables.

The only way I can think of to do it would be to get the date components you want from Time measures then have a OnLeftMouseUpAction on some meter that when clicked, would use !WriteKeyValue to set the URL as you desire, then it would refresh the skin. It would really HAVE to be manual, in that it would require you clicking on something to fire it off however, or you will get into an endless loop. Even then, Date+1 is going to be tricky unless you jump out to Lua, as the Time measure only returns a formatted string for the current date, and there is no easy way to do math with that in Rainmeter.
User avatar
NamesTwister
Posts: 7
Joined: July 29th, 2011, 1:31 am
Location: USA

Re: Quick Question - Inserting the current date into a URL

Post by NamesTwister »

Alright thanks! Wasn't sure if it was possible, I'll give Lua a try though.
Terrorlone
Posts: 6
Joined: August 15th, 2011, 12:08 pm

Re: Quick Question - Inserting the current date into a URL

Post by Terrorlone »

Read my lastest post under "Tips & Tricks" for a solution to this!