here is my suggestion...

<cfscript>
// find the second anchor tag
artistIndex = find("<a ", cfhttp.filecontent, find("<a ",
cfhttp.filecontent)+2);
// strip everything before the second anchor tag
content = removeChars(cfhttp.filecontent,1,artistIndex);
// artist name is all text between start and end anchor tags
artistName = listRest(listFirst(content,"<"),">");
// strip characters up to and including the first <br> tag
content = removeChars(content,1,find("<br>",content)+3);
// song name is all text before next <br> tag
songName = listFirst(content,"<");
</cfscript>

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
TeleCommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis

"Let's Roll"
        - Todd Beamer, Flight 93



-----Original Message-----
From: John Gedeon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 10:20 AM
To: CF-Talk
Subject: RE: CFHTTP question


Bryan
    below is the snapshot of the data i have. I want to get the artist name 
and song name in this case it is "Castlevania, Dracula New Class" and 
"Vampire Killer"

John
<tr>
         <td 
background="http://www.streamingsoundtracks.com/images/bg_name.gif"; 
width="22%" nowrap>Visitors: <a href='http://www.perlonline.com' 
style="">47</a><br>
         Requests: 1/Hour<br>
         Listeners: 149/185</td>
         <td align="center" 
background="http://www.streamingsoundtracks.com/images/bg_name.gif"; 
width="56%" nowrap>
         <a 
href="http://www.amazon.com/exec/obidos/external-search/?mode=music&tag=nopa
tience&keyword=Castlevania, 
Dracula New Class">Castlevania, Dracula New Class</a>
          - <a 
href="http://www.amazon.com/exec/obidos/external-search/?mode=music&tag=nopa
tience&keyword=Konami">Konami</a><br>
         Vampire Killer (7:05)<br>
         <img 
src="http://www.streamingsoundtracks.com/images/simages/fourh.gif";
border="0">
<br><font face="Verdana" size="2" color="">
</font>
</td>
         <td align="center" 
background="http://www.streamingsoundtracks.com/images/bg_name.gif"; 
width="22%">
         <a onclick="NewWindow(this.href,'name','510','170','yes');return 
false;" 
href="http://www.streamingsoundtracks.com/cgi-bin/rating/stars/stars.pl?Cast
levania_DNC">Rate 
It</a></td>
       </tr>


At 10:10 AM 9/24/2002 -0700, you wrote:
>Text parsing is somewhat of a lost art.  It's easy to do, but difficult to
>do well.  Your question is too general for me to provide a detailed answer.
>If you want to provide a sample of the data you want to parse perhaps I can
>be of some help...
>
>+-----------------------------------------------+
>Bryan Love
>   Macromedia Certified Professional
>   Internet Application Developer
>   Database Analyst
>TeleCommunication Systems
>[EMAIL PROTECTED]
>+-----------------------------------------------+
>
>"...'If there must be trouble, let it be in my day, that my child may have
>peace'..."
>         - Thomas Paine, The American Crisis
>
>"Let's Roll"
>         - Todd Beamer, Flight 93
>
>
>
>-----Original Message-----
>From: John Gedeon [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, September 24, 2002 9:52 AM
>To: CF-Talk
>Subject: CFHTTP question
>
>
>I have a cfhttp get call  to get another text webpage. I get the file fine
>but I want to parse out the useful data from that page that i get and I am
>not sure what the easiest way is. the data i am looking for is dynamic and
>can be one to many words. but it always starts at the same spot. whats the
>easiest way to parse it out.?
>
><>< Proverbs 3:5 "Trust in the Lord with all your heart and lean not on
>your own understanding;"
>
>
>

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to