Below is somehting I use (someone on the list here - sorry, I can't remember
who - helped me with it).  It grabbs Moreovers headlines, dumps them into a
database to load locally.  I use a scheduled script to update the headlines
hourly.  You set your "endrow" attribute in the CFLOOP to however many
headlines you want.  You can write it directly to your page if you don't
want to mess with the database.  I use the database to avoid slow loading.


headliner.cfm
========================================================
<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>


Display in a CF page:
==================================================
<TABLE ALIGN="CENTER">
<CFQUERY NAME="GetNews" DATASOURCE="mtnstate-1">
 SELECT *
 FROM News
</CFQUERY>
<TR VALIGN="TOP">
 <TD BGCOLOR="#FFBF00">
 <CENTER><FONT SIZE="3" COLOR="#2D3776"><B>Current Firearms
Headlines</B></FONT></CENTER>
<CENTER>
<TABLE BGCOLOR="#FFFFFF" WIDTH="95%" BORDER="0" CELLSPACING="0"
CELLPADDING="2">
<CFOUTPUT QUERY="GetNews">
<TR>
 <TD><A HREF="#NewsURL#" TARGET="_blank">
<FONT FACE="Verdana" COLOR="##2D3776"><B>#NewsHeadline#</B></FONT><BR>
<FONT FACE="Verdana" SIZE="-2" COLOR="##000000">#NewsSource#</FONT>
</A></TD>
</TR>
</CFOUTPUT>
</TABLE>


DB layout:
======================================
Table:    News

Columns:  NewsItemID, NewsHeadline, NewsSource



=================================
"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: Adrian Cooper <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 13, 2000 10:35 AM
Subject: Moreover News tag?


Is there a tag out there to get Moreover news?

Thanks.

Adrian Cooper.


----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
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.mail-archive.com/cf-talk@houseoffusion.com/
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