RE: Stripping end of cfhttp.filecontent

2002-12-02 Thread Steve Reich
Try this

cfhttp URL=#WWURL#
  method=get
  resolveurl=true/cfhttp


cfscript
// Replace link colors and rename content
color = ReReplace(#cfhttp.filecontent#, 800854, 99, All);
// Modify all links to second agent page with variable
links = ReReplaceNoCase(#Variables.color#,
http://url.domain.com/ppp97n260/;, pp2.cfm?id=, All);
// Find point in content to strip to from beginning of file
count = Find('/NOBR
 P
NOBR', #Variables.links#) -1;
// Remove from beginning to the above point
postlist = RemoveChars(#variables.links#, 1, #Variables.count#);
// Display everything left of the /form tag.
postlist=left(postlist, findnocase(/form, postlist) -1);
/cfscript


cfoutput
#postlist#
/cfoutput




HTH,
Steve

-Original Message-
From: Cathy Taylor [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 11:32 AM
To: CF-Talk
Subject: Stripping end of cfhttp.filecontent


This is probably a really easy and dumb question. I have a page that grabs
another page and strips most of the ads, images, and unnecessary
information. Then it displays the bulk of the page. At the end are more ads
and unnecessary junk I'd also like to stip off, but I'm not sure how to do
that. Here is the code that I have so far that is just missing the stripping
from a certain point (for example after a /FORM tag, I'd like to strip to
the end of the content). Help? Thanks!

Cathy

***

cfhttp URL=#WWURL#
  method=get
  resolveurl=true/cfhttp

CFSET color = ReReplace(#cfhttp.filecontent#, 800854, 99, All)
!--- Replace link colors and rename content ---
CFSET links = ReReplaceNoCase(#Variables.color#,
http://url.domain.com/ppp97n260/;, pp2.cfm?id=, All) !--- modify all
links to second agent page with variable ---
cfset count = Find('/NOBR
 P
NOBR', #Variables.links#) -1 !--- find point in content to strip to from
beginning of file ---

CFSET postlist = RemoveChars(#variables.links#, 1, #Variables.count#)
!--- Remove from beginning to the above point ---

!--- Post what's left ---
cfoutput
#postlist#
/cfoutput

**

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



Re: Stripping end of cfhttp.filecontent

2002-12-02 Thread Cathy Taylor
Thanks! That did the trick!

Cathy

Date: 12/02/2002 12:03 PM
Author: Steve Reich

Try this 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com