[WebDNA] Daily tasks without triggers

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107191
interpreted = N
texte = > Hot stuff, this is a brilliant idea, why didnt I think of > this. Thanks a bunch, this will allow me to figure out > when something hasnt triggered that is supose to trigger. I find that on most sites I have a good reason to run some code once a day, but it really doesn't matter what time of the day it runs. If you have the same need just put this into your home page, or whatever other page gets at least one visit per day: [showif [date]![include dailyTasksDate]] your code goes here ... [writefile dailyTasksDate][date][/writefile] [/showif] This will insure that your code is run once a day, upon the first page visit of the day, then it won't run again until the first visit on the next day. No triggers required. To alert yourself that this code was run, just put this inside the showif: [sendmail from=&to=&subject=Daily tasks: [time]][/sendmail] Or if you won't want a daily email just log the daily tasks like this: [appendfile dailyTasksLog][date] [time] [ipaddress] [/appendfile] If you're running lots of code it will speed things up by putting it inside a separate "dailyTasks" file so that WebDNA does not have to parse it all. This technique usually helps in other places in the website too: [showif [date]![include dailyTasksDate]] [include dailyTasks] [writefile dailyTasksDate][date][/writefile] [/showif] And if you're running code that takes a long time to run, you can improve the page load speed for your first visitor of the day with this technique: [showif [date]![include dailyTasksDate]] [spawn] [include dailyTasks] [writefile dailyTasksDate][date][/writefile] [/spawn] [/showif] Sincerely, Kenneth Grome Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Daily tasks without triggers (Marc Thompson 2011)
  2. [WebDNA] Daily tasks without triggers (Kenneth Grome 2011)
> Hot stuff, this is a brilliant idea, why didnt I think of > this. Thanks a bunch, this will allow me to figure out > when something hasnt triggered that is supose to trigger. I find that on most sites I have a good reason to run some code once a day, but it really doesn't matter what time of the day it runs. If you have the same need just put this into your home page, or whatever other page gets at least one visit per day: [showif [date]![include dailyTasksDate]] your code goes here ... [writefile dailyTasksDate][date][/writefile] [/showif] This will insure that your code is run once a day, upon the first page visit of the day, then it won't run again until the first visit on the next day. No triggers required. To alert yourself that this code was run, just put this inside the showif: [sendmail from=&to=&subject=Daily tasks: [time]][/sendmail] Or if you won't want a daily email just log the daily tasks like this: [appendfile dailyTasksLog][date] [time] [ipaddress] [/appendfile] If you're running lots of code it will speed things up by putting it inside a separate "dailyTasks" file so that WebDNA does not have to parse it all. This technique usually helps in other places in the website too: [showif [date]![include dailyTasksDate]] [include dailyTasks] [writefile dailyTasksDate][date][/writefile] [/showif] And if you're running code that takes a long time to run, you can improve the page load speed for your first visitor of the day with this technique: [showif [date]![include dailyTasksDate]] [spawn] [include dailyTasks] [writefile dailyTasksDate][date][/writefile] [/spawn] [/showif] Sincerely, Kenneth Grome Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebSTAR virtual roots with . in the foldername (2000) Running subtotal? (1998) MacActivity and PCS (1997) Trouble with Netscape (1998) Searching multiple fields from one form field (1997) Problems w/ heavy use of cart header fields? (1998) hiding the "Sorry WebDNA server not running" message (2005) absolute paths for databases? (1997) Problem with my orders (1998) WebCat hosting providers? (1997) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) ShowNext Command (1997) [shownext max=?] armed (1997) WebDNA-generated email headers (2003) Searching multiple Databases (1997) Part Html part WebDNA (1997) Check boxes (1997) Weird problems with [SHOWIF]s (1997) Serial Number Question (1997) math on date? (1997)