I too am on the make my own blog bandwagon.
For this type of information you have many choices
Easy: Use Cheetah to render your pages,
#cache timer='30m', id='cache1'
#for $blog in $blogroll
Cache it in yout module, use a module level variable to hold the data
and use TaskKit to update it.
I would not store this type of info to disk.
Another option is to write the entire blog page to disk as an HTML page
(how often does that update?) and then use Webware as a 404 handler to
generate pages on the fly or update them as needed.
> hi there,
> i'm writing a simple blog system with python to learn the language and
> the webware framework. i've figured out most of the basic things, and
> now i'm moving to more advanced stuff.
> i was wondering what is the best way to include static contents in a
> webware servlet. consider this situation: tipically a blog sidebar
> contains a list of things that do not need to get updated frequently
> (blog rolls wih a "last updated" date, a calendar, recent photos--just
> to name a few).
> i thought to update this things on a, say, daily basis via taskkit.
> a tipical blog roll (example here: http://simon.incutio.com/)
> generation task would be:
> * read a db table and fetch a service like weblogs.com with a list
> of blogs of interest
> * parse weblogs.com output and build an HTML <ul> list with blog title
> and "last updated" value
> * write HTML snippet to disk
> so, at every page request webware just include such static
> HTML list in the servlet output instead to compute a possibly
> lengthly operation.
> i've seen that Page has an includeURL() method, where URL is the URL
> for another servlet, not a file. correct? of course i could
> add something like to my WeblogPage object:
> def includeFile(self, fname)
> included = file(fname, 'r')
> s = included.read()
> return s
> to include an arbitrary file, but i would like to known how
> you would solve this problem.
> thanks in advance.
> PS: from the taskkit docs it's not clear to me how
> to specify frequency for a task (say twice a day), once
> a week and so on.
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
> same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
> Webware-discuss mailing list
"I don't know what's wrong with my television set. I was getting
C-Span and the Home Shopping Network on the same station.
I actually bought a congressman."
- Bruce Baum