I´ve created a VERY simple page to write a newsletter in - this page generates a simple rss feed from where an external partner creates the newsletter.
My question is - can I somehow have the content in the two text-fields (Title, Description) deleted on a daily basis as a scheduled task, lets say at 12:00 pm each day...?
Have this kind of customization ever been made to the API...?
I believe it's a matter of writing a service or something that is instructed to delete the content in the above fields and the configure the scheduled task in the umbracoSettings.config section <scheduledTasks>.
But be aware that if for some reason the webserver is down the tasks of course won't run.
Further to Jan's post, the scheduled Task that he describes will only work when the application pool is active (as opposed to the server being down).
So if your site does not get much traffic it is likely that the application pool will be "asleep" and the scheduled task will only run once someone browses your site.
To "fudge" site activity you could use something like pingdom to ensure the site is working.
However the above is a bit clunky.
The alternative would be to create a scheduled task on the server to run a URL at a specified time each day.
If you are on a shared hosting environment sometimes you have an option to load a scheduled task within your control panel. I have never done this personally.
If you have access to the server then "Administrative Tools" - "Task Scheduler" is where you can load a task. The way I have achieved this is to write a visual basic script to run the webpage - the scheduled task is then loaded to the run the VB script. The code below is what I use for this process.
Call LogEntry() Sub LogEntry()
'Force the script to finish on an error. On Error Resume Next
'Declare variables Dim objRequest
Dim URL Set objRequest = CreateObject("Microsoft.XMLHTTP")
Delete text-strings as a scheduled job/cron job
I´ve created a VERY simple page to write a newsletter in - this page generates a simple rss feed from where an external partner creates the newsletter.
My question is - can I somehow have the content in the two text-fields (Title, Description) deleted on a daily basis as a scheduled task, lets say at 12:00 pm each day...?
Have this kind of customization ever been made to the API...?
Hi Robin
I believe it's a matter of writing a service or something that is instructed to delete the content in the above fields and the configure the scheduled task in the umbracoSettings.config section <scheduledTasks>.
But be aware that if for some reason the webserver is down the tasks of course won't run.
Hope this answers your question.
/Jan
Further to Jan's post, the scheduled Task that he describes will only work when the application pool is active (as opposed to the server being down).
So if your site does not get much traffic it is likely that the application pool will be "asleep" and the scheduled task will only run once someone browses your site.
To "fudge" site activity you could use something like pingdom to ensure the site is working.
However the above is a bit clunky.
The alternative would be to create a scheduled task on the server to run a URL at a specified time each day.
If you are on a shared hosting environment sometimes you have an option to load a scheduled task within your control panel. I have never done this personally.
If you have access to the server then "Administrative Tools" - "Task Scheduler" is where you can load a task. The way I have achieved this is to write a visual basic script to run the webpage - the scheduled task is then loaded to the run the VB script. The code below is what I use for this process.
The file should be saved with a "vbs" file suffix
Hope this helps.
Nigel
Hm - I need some additional infoes to this... - the names of the textfields is: rssTitle and rssDescription.
The website is getting enough visits pr. day - so I would'nt worry about that.
Can I write the script in c# and put it in the App_Code folder - if yes, how would the script look like...?
Sometimes external scheduled task service like http://www.easycron.com built with many enhanced features is handy for use and powerful too.
You could try using my taskscheduler package, maybe?
is working on a reply...