Thanks! That generated the output I needed. I also figured out why you got the 404 (aside from an extra slash)... the day is always 'yesterday'. I tried to define yesterday with a timedelta, but can't figure out where I would put that. I tried searching for a guide on cheetah on how I could format strftime directly, but haven't been successful. Any other advice would be very helpful!
-JZ On Sunday, September 16, 2018 at 1:11:09 PM UTC-5, Pat wrote: > > The Cheetah generator can use #echo to print > <http://cheetahtemplate.sourceforge.net/docs/users_guide_html/users_guide.html#SECTION000810000000000000000> > the > date (and other things)... So you can try this in index.html.tmpl: > > > #echo time.strftime('%Y%m%d')# > > So the full line would be: > > <img src="https://twc.tamu.edu/weather_images/rawsfcst/rawsfcst/#echo > time.strftime('%Y%m%d')#.png"> > > > Which gives me this output: > > <img src=" > https://twc.tamu.edu/weather_images/rawsfcst/rawsfcst/20180916.png"> > > But that img returns a 404 for me, so I think you're missing something. > Either way, hopefully this is enough to get you started. > > > On Sunday, September 16, 2018 at 1:50:18 PM UTC-4, Jonathan Zitelman wrote: >> >> I am using the standard skin on WeeWX 3.8.0. I am trying to include a >> link to a remote image, but the filename changes each day. I have >> attempted adding it directly to index.html.tmpl using PHP (I know, not the >> correct location): >> >> https://twc.tamu.edu/weather_images/rawsfcst/rawsfcst<?php echo >> date(Ymd); ?>.png >> >> >> But it does not look like there is a PHP parser. Next I added it into >> the Extras section on skin.conf using direct python replacement, but it >> does not parse correctly and spits out the actual code in the final HTML >> document: >> >> https://twc.tamu.edu/weather_images/rawsfcst/rawsfcst' + >> datetime.strftime.today().strftime('%Y%m%d') + '.png >> >> >> Lastly I tried python using string replacement, and this seems to break >> the skin.conf file: >> >> skin.conf Code: >> >> fire_date = datetime.strftime.today().strftime('%Y%m%d') >> fire_img = "https://twc.tamu.edu/weather_images/rawsfcst/rawsfcst%s.png" >> % (fire_date) >> >> >> Error: >> >> reportengine: Failed to read skin configuration file >> /etc/weewx/skins/Standard/skin.conf for report StandardReport: Parse error >> in value at line 17. >> >> >> Does anyone have suggestions on what code to use? Or if I should be >> adding this in a different file? The file on the other site is always >> "rawsfcstYYYYMMDD.png" and I just need to parse out the date in the report. >> >> -Jonathan † >> >> -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.