setting template variables from plugins/ unkludging code/
"William Cybriwsky" <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm a new user of pyblosxom, and I wanted to know how to set template
variables from a plugin. I currently have the chunk of python code:
import os
from xml.dom import minidom
username = "putusernamehere"
password = "putpasswordhere"
getxml="curl -u %s:%s http://twitter.com/statuses/user_timeline.xml?count=1>
tmptwit.xml" % (username,password)
os.system(getxml)
ourxml=minidom.parse("tmptwit.xml")
currentstatus=ourxml.childNodes
[0].childNodes[1].childNodes[5].childNodes[0].data
py['twitterstatus']=currentstatus
which functions when placed in config.py, but this is obviously not how it
should be done. I'm working in a controlled hosting environment, so I don't
have pyblosxom installed as a module (as in I'm using py["codebase"]).
P.S. : if I wanted to write some simple cache code, how would I just do a
check for a file age of 60 seconds?
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Pyblosxom-devel mailing list
Pyblosxom-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/pyblosxom-devel