SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
SI - Site Forums : Silicon Investor - Welcome New SI Members! -- Ignore unavailable to you. Want to Upgrade?


To: Tom Swift who wrote (19649)9/16/2003 8:30:12 PM
From: Green Receipt  Respond to of 32883
 
It would be really easy to insert such a quote even as Quahog suggested too. the catch would be to just put a little * and a disclaimer at the bottom that stated the quote was delayed 20 minutes.

Alternatively if you wanted the real time quote for historical purposes, it would be really simple to stick a keyword (si bob's work to do) in place where the quote would end up like %%REALTIME_DELAYED_QUOTE%%, and then add a quote request with a future time of 20 minutes along with the message # of the post (like 19312169). That chunk of data would then sit in a queue. Another job would have the sole purpose of sorting the queue by time (it may already end up being in time order) and then whenever 'now' = the next thing's request time, do a http get request on yahoo or somewhere for the non-realtime quote and then parse the resultant html.

Since all these requests would be in a queue waiting to be processed, and since the granularity is about 1 minute (how often the real time quote changes? -- not sure about that), that would mean this other job would have to serve all items in the queue matching for a particular minute in a minute or less. This should be an easy goal to attain.

extract the quote info, and then do a database operation set:

select blobrecord where messageid = <<saved messageid>>
Scan thru the blob text field and replace %%REALTIME_DELAYED_QUOTE%% with the quote that was just received. Then update that db record.

Since a 20 minute lag exceeds the 15 minute edit window given to users, there wouldn't be a problem with a user making a change accidently.

Alternatively, store the delayed quote as a separate field in the table and then just update directly with the data

There are many ways to go about implementing such an idea. Thats just one possibility among hundreds, if not thousands.