<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 »</a></div>
</div>
</div>
Asked
Active
Viewed 195 times
0

Henry
- 32,689
- 19
- 120
- 221

Eric Sauers
- 41
- 1
- 4
-
How would I use a substring to remove only tweets with @ as the first character? – Eric Sauers Apr 30 '10 at 14:40
1 Answers
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 -
-
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.