Entry
Using Zope, can I obtain the current exchange rates for the yen, mark, etc. at least once a day, preferrably every other 15 minutes?
Jul 18th, 2000 03:56
unknown unknown, ethan mindlace fremen, Loren Stafford, Peter Be
It depends on where the exchange rates are.
If you get them from a database, you can make zope display the current
rates.
If you get them from a web page, you can use the client feature of zope
to go snarf the web page and then extract what you need (hope you have
permission :)
If some other mechanism can write them to a file, you can suck them up
with an external method whenever someone asks for it.
-------
For doing things periodically there's the ZScheduler product
(http://www.zope.org/Members/lstaffor/ZScheduler). The product is in
it's alpha development stage, but if you employ it cautiously, you may
find that it works for you.
For getting the exchange-rate data, it depends on where it's coming
from. Give us some more details and perhaps we can help better.
You might want to use ZClient (see the How-To at
http://www.zope.org/Members/lstaffor/ZClientMethod).
There's also the SiteSummary product
(http://www.zope.org/Members/edmundd/SiteSummary/).
If you don't have too much traffic on your site, you can let the "first
user of the day" be responsible for triggering new values to a db/file
using the ZopeTime function.
Something like this maybe:
IF (SELECT day FROM currencytable == ZopeTime(day)):
SHOW FROM DB
ELSE:
START THE COLLECTORS SCRIPT
AND PUT IN THESE VALUES IN THE DB