11-18-2010, 05:05 AM
Function cTwitterDate
Function TwitterParse
Yep. Pretty Much from here it's pretty simple. I ended up just putting the date at that start of a string and then populated an array. Used sort(1). Got exactly what I wanted.
function str&TwitterDate
ARRAY(str) a
int i=findrx(TwitterDate "(\w{3}), (\d{2}) (\w{3}) (\d{4}) (\d{2}:\d{2}:\d{2})" 0 0 a)
str sDate=F"{a[3]}-{a[2]}-{a[4]} {a[5]}"
DATE dDate=sDate
sDate.timeformat("{yyyy}{MM}{dd}{HH}{mm}{ss}" dDate)
TwitterDate=sDate
Function TwitterParse
function str&Data
IXml x=CreateXml
x.FromString(Data)
Data=""
ARRAY(IXmlNode) a
x.Path("rss/channel/item" a)
int i
for i 0 a.len
,IXmlNode n=a[i].FirstChild
,for _i 0 6
,,if(!n) break
,,sel _i
,,,case 2
,,,str TimeStamp=n.Value
,,,cTwitterDate TimeStamp
,,,case 0
,,,str Title=n.Value
,,,Title.findreplace("[]" " ")
,,n=n.Next
,str Tweet=F"({TimeStamp}) {Title}"
,Data.addline(Tweet)
Yep. Pretty Much from here it's pretty simple. I ended up just putting the date at that start of a string and then populated an array. Used sort(1). Got exactly what I wanted.