OK, quite a few folks have asked for the code I use so I'll just post it now.  First, 
I had help from this list with this, but I'm
sorry that I forgot who to credit with helping me.  You know who you are:

Here's what I do.  You can use Moreover.com for news headline feeds on MANY subjects.  
This one is for Firearms Related news.  Now,
they do offer a javascript to go out and grab the headline when the page is loaded.  
Problem is, if there is net congestion, or
their server is down, it can really slow down your page load (it does even when there 
isn't much net congestion) or worse off -
prevent your page from loading.  So what I wanted to do is download the headlines and 
associated links into a local database so the
page would load fast.  I run this code (called headliner.cfm) hourly via the CF 
Scheduler (yea, yea, I know - it doesn't work for
some, but I've found that it's pretty reliable for http calls - both on my own servers 
and on shared servers at ISP's - Hostpro.com
in this case).  The advantages are;  Again, faster page loading of headlines from 
local source and if there is net congestion that
would prevent updating when the hourly script runs, you still have the previous hours 
info so your page still loads.

"Nuf said:  here it is:

<CFOUTPUT>
    <CFHTTP URL="http://p.moreover.com/cgi-local/page?index_firearms+cf"
                  METHOD="GET">
    </CFHTTP>
</CFOUTPUT>

<CFWDDX  ACTION="WDDX2CFML"
                  INPUT="#CFHTTP.FileContent#"
                  OUTPUT="stHeadlines">

<!--- STICK IT ALL IN THE DB --->
<CFSET Count = 1>
<CFOUTPUT>
    <CFLOOP QUERY="stHeadlines" endrow="5">
        <CFQUERY NAME="insertNews" DATASOURCE="mtnstate-1">
             UPDATE News
             SET   NewsURL = '#stHeadlines.url#',
                      NewsHeadline = '#stHeadlines.headline_text#',
                      NewsSource = '#stHeadlines.source#'
             WHERE NewsItemID = #Count#
        </CFQUERY>
<CFSET Count = #Count# + 1>
    </CFLOOP>
</CFOUTPUT>


=================================
"What we need is a list of specific unknown problems we will encounter"

David Hannum
Web Analyst/Programmer
Ohio University
[EMAIL PROTECTED]
(740) 597-2524



----- Original Message -----
From: Robert Everland III <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 22, 2000 8:56 PM
Subject: RE: WDDX OR XML News Feeds


I would be interested in it if you would like to share.

Bob Everland

-----Original Message-----
From: David Hannum [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 22, 2000 8:40 PM
To: [EMAIL PROTECTED]
Subject: Re: WDDX OR XML News Feeds


You can grab the Moreover.com headlines via CFHTTP and WDDX2CFML function.
I do it on a site I'm developing.  However, for speed, I made a template
that runs hourly and dumps the headlines and links into a database locally
so that it will load faster.  If you want the code, email me off list.
Works like a charm.  I know that some folks have some trouble with the
CFScheduler but on my development box, a production box and a shared server
at an ISP, it seem to be stable for HTTP calls.

Dave


----- Original Message -----
From: Robert Everland <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 22, 2000 3:45 PM
Subject: WDDX OR XML News Feeds


> Can anyone give me a link where I may be able to get some news feeds
> off of sites so that I may put them on my intranet. Please specify if they
> carry the whole story or only headlines.
>
> Robert Everland III
> Web Developer
> Dixon Ticonderoga
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to