0
 <div id="rssConsumer" style="width:100%; border:1px solid #e8e8e8; margin:0px 0px 15px 0px;"><div style="margin:8px 10px 8px 10px; font-weight:bold; font-size:1.4em;">Recent Tweets</div>

    <cffeed action="read" source="http://twitter.com/statuses/user_timeline/7717612.rss"  name="tweetfeed">
    </cffeed>
    <cfloop from="1" to="3" index="i">
    <cfoutput>
    <div style="margin:8px 10px 8px 10px; padding:0px 0px 8px 0px; border-bottom:dotted; border-color:##CCC;">
    <cfset noWharton =  Right( #tweetfeed.item[i].title#, len(#tweetfeed.item[i].title#) - 9)>
    <cfset newDate = Mid(#tweetfeed.item[i].pubdate#,5,12)>
    #noWharton#<br />
    #newDate#</div>
    </cfoutput>
    </cfloop>

  <div style="margin:0px 10px 10px 10px;"><a href=http://twitter.com/wharton target="_blank">more &raquo;</a></div>

    </div>

    </div>
Henry
  • 32,689
  • 19
  • 120
  • 221
Eric Sauers
  • 41
  • 1
  • 4

1 Answers1

1
<cfloop from="1" to="3" index="i">
    <cfif find("@", tweetfeed.item[i].title) eq 0 >    
        <cfoutput>
            <div style="margin:8px 10px 8px 10px; padding:0px 0px 8px 0px; border-bottom:dotted; border-color:##CCC;">
            #Right( #tweetfeed.item[i].title#, len(#tweetfeed.item[i].title#) - 9)#<br />
            #Mid(#tweetfeed.item[i].pubdate#,5,12)#
            </div>
        </cfoutput>
    </cfif>
</cfloop>
zarko.susnjar
  • 2,053
  • 2
  • 17
  • 35
  • How would I use a substring to remove only tweets with @ as the first character? – Eric Sauers Apr 30 '10 at 14:40
  • find will return index of an occurrence, in this case 1, right? So you need – zarko.susnjar Apr 30 '10 at 15:08
  • Sweet! Thanks your a life saver! – Eric Sauers Apr 30 '10 at 15:14
  • left(tweetfeed.item[i].title,1) EQ "@" is more efficient. Also, cfoutput tag should be outside of cfloop. – Henry Apr 30 '10 at 18:31
  • Acctually, if we are nitty-gritty xml looks like this, so neither solution is 100% correct: zarkosusnjar: @markosimic quote: "Don't worry, it only seems kinky the first time." :D ... Seems that in personal rss you never get @ at first place so: would be easiest solution without using reg.expression. – zarko.susnjar Apr 30 '10 at 19:30