rebol[ Title: "xanga.r" Author: "Tim Wylie" Date: "May 18, 2007" Description: "This simply pulls the posts and comments from a xanga site, and can export to wordpress xml." ] xanga: make object![ make-comment: func[][ make object![ user: none userlink: none text: none date: none ] ] make-post: func[][ make object![ title: none text: none date: none comments: none user: none categories: none ] ] output: func[str[string!]][either value? 'ext-output [ext-output str][print str]] make-date: func[dt [string!]/locals tmp tm][ tmp: parse dt none tmp_dt: parse tmp/2 "/" either tmp/4 = "PM" [either (not find tmp/3 "12:") [tm: (to-time tmp/3) + 12:00][tm: tmp/3]] [either (find tmp/3 "12:")[tm: (to-time tmp/3) - 12:00][tm: tmp/3]] to-date rejoin[tmp_dt/2 "/" tmp_dt/1 "/" tmp_dt/3 " " tm] ] ;this gets the data from each comment get-comment: func[page [string!] /locals coms com usr usrlnk txt dt][ if error? try[ com: make-comment page: find page {
(com/text: txt) thru