It is currently April 24th, 2024, 9:25 am

How to automatically change a URL based on the date?

Get help with creating, editing & fixing problems with skins
Xune531
Posts: 9
Joined: March 16th, 2010, 10:01 pm

How to automatically change a URL based on the date?

Post by Xune531 »

I want to make a skin that downloads and image based on what day it is. Everyday the image is uploaded to be up to-date, and the link changes based on what day of the month it is.

For example

It is the 5th of August

Yeasterday the URL was
http://www.Image.com/4.jpg

Today it was
http://www.image.com/5.jpg

Tommorrow it will be
http://www.image.com/6.jpg

I need a way to make it so the URL change in the Measure so it will download the up-to-date image. I assume the way to do this is with a calc, but the manual isn't too great on teaching how to use that.

Here's the code:

Code: Select all

[Variables]
FontFace=Trebuchet MS
FontColor=255,255,255,255
FontSize=15
;To find your PaperID, got to http://www.newseum.org/todaysfrontpages/main.asp and find your newspaper.  Then use the code after "fpVname="
;PaperID=CAN_TGAM
;Example above is for Candada's Globe and Mail at: http://www.newseum.org/todaysfrontpages/hr.asp?fpVname=CAN_TGAM&ref_pge=lst
PaperID=MA_BG
ImageWidth=315
ImageHeight=415
ImageWidthSmall=315
ImageHeightSmall=415
BGcolor=0,0,0,200
;=============================================
[SolidBackground]
Meter=IMAGE
Solidcolor=#BGColor#
X=34
Y=28
W=248
H=430


[MeasureDate]
Measure=Time
Format=%d

[Measuredaynumber]
Measure=Calc
Formula=

[MeasureNewseum]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
URL=http://www.newseum.org/todaysfrontpages/hr.asp?fpVname=#PaperID#&ref_pge=gal&b_pge=1
RegExp="(?siU)<div id="tfpTitle_container">.*<li><em>(.*)</em>.*<li><a class="noBorder" href="(.*)">Web Site.*<div class="tfpLrgView_container"><img class="tfp_lrg_img" src="../../../../media/dfp/jpg5/lg/(.*)" alt="

[MeasureNewspaperName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureNewseum]
StringIndex=1
Substitute=",":""

[MeasureNewspaperLink]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureNewseum]
StringIndex=2

[MeasureNewspaperImageName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureNewseum]
StringIndex=3

[MeasureNewspaperImageLink]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL="http://webmedia.newseum.org/newseum-multimedia/dfp/jpg6/lg/#PaperID#.jpg"
Download=1
DownloadFile=#PaperID#.jpg
StringIndex=1
Debug=1

[MeterBackground]
Meter=Image
W=250
H=340
SolidColor=0,0,0,1

[MeterName]
Meter=String
MeasureName=MeasureNewspaperName
FontFace=#FontFace#
FontSize=#FontSize#
FontColor=#FontColor#
AntiAlias=1
X=10
Y=0
W=420
H=25

[MeterImageLink]
Meter=Image
ImageName=DownloadFile\#PaperID#.jpg
W=#ImageWidth#
H=#ImageHeight#
PreserveAspectRatio=1
DynamicVariables=1
X=0
Y=35r
LeftMouseDoubleclickaction=!Execute [#SKINSPATH#\FrontPage\DownloadFile\#PaperID#.jpg]