views:

51

answers:

1
 <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>
+1  A: 
<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
How would I use a substring to remove only tweets with @ as the first character?
Eric Sauers
find will return index of an occurrence, in this case 1, right? So you need <cfif NOT (find("@", trim(tweetfeed.item[i].title)) eq 1)>
zarko.susnjar
Sweet! Thanks your a life saver!
Eric Sauers
left(tweetfeed.item[i].title,1) EQ "@" is more efficient. Also, cfoutput tag should be outside of cfloop.
Henry
Acctually, if we are nitty-gritty xml looks like this, so neither solution is 100% correct:<item> <title>zarkosusnjar: @markosimic quote: "Don't worry, it only seems kinky the first time." :D</title>...Seems that in personal rss you never get @ at first place so:<cfif findNoCase(": @",tweetfeed.item[i].title)>would be easiest solution without using reg.expression.
zarko.susnjar