faqts : Computers : Internet : Web Servers : Zope : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 7 people (71%) answered Yes
Recently 2 of 4 people (50%) answered Yes

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