RE: new snapshot - new fetch functionality
| From: | Monte Ohrt | Date: | Thu, 14 Mar 2002 03:50:57 +0000 |
| Subject: | RE: new snapshot - new fetch functionality | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3048@lists.php.net to get a copy of this message | ||
Actually we already have that routine written for a client, I'll look it
up. They fetch the weather but don't want it fetched on every hit, just
every 30 minutes.
Jimmy Harlindong wrote:
>
> Oh yes that would be much cleaner, I agree.
>
> OK here's another idea.... can the fetch be cached, and say either
> refresh the fetch only when there's new document (using http expire or
> date?) or only refetch at a certain time and at other time use the
> cache? It'd be useful if I want to fetch a news site say every 3 hours
> or every 9 am in the morning (barring any time difference)
>
> I think I can write the extraction routine as a custom function or
> better yet if the *extracted* data can be cached as well.... oh well
> ideas ideas :)
>
> cheers
>
> > -----Original Message-----
> > From: Monte Ohrt [mailto:monte@ispi.net]
> > Sent: Thursday, 14 March 2002 1:03 PM
> > To: Jimmy Harlindong
> > Cc: smarty@lists.ispi.net
> > Subject: Re: [smarty] RE: new snapshot - new fetch functionality
> >
> >
> > like what? strip out the links, or strip out the html tags?
> >
> > Maybe that should be another function or modifier, so you can
> > use it for
> > any text.
> >
> > {fetch file=$url assign="contents"}
> >
> > {$contents|extract_links}
> > {$contents|strip_html_tags}
> >
> > Jimmy Harlindong wrote:
> > >
> > > Monte,
> > >
> > > This is great, and maybe you can also add the function to
> > let us filter
> > > / extract certain parts of the fetched document too?
> > >
> > > Cheers
> > > Jimmy