This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Another useful script
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants
Advertisement
For all you gaming geeks out there, the script below scrapes Dork Tower into a local RSS feed:
| writer content str rest out |
contentBlock := [:builder :chunk |
| stream base link |
base := 'http://archive.gamespy.com/comics/dorktower/'.
stream := ReadStream on: chunk.
link := stream upTo: $".
builder link: base, link.
builder title: 'Dork Tower For: ', Core.Date today printString.
builder description: '<img src="', (base, link), '">'.
builder pubDate: Core.Timestamp now].
out := 'dorkTower.xml' asFilename writeStream.
[writer := RSS20_SAXWriter new output: out.
writer prolog.
writer startRSS.
writer startChannel.
writer title: 'Dork Tower Feed'.
writer link: 'http://archive.gamespy.com/comics/dorktower/'.
writer description: 'Dork Tower Feed'.
writer pubDate: Core.Timestamp now.
writer startItem.
writer title: 'Dork Tower For: ', Core.Date today printString.
content := 'http://archive.gamespy.com/comics/dorktower/' asURI valueStream contents.
str := content readStream.
str upToAll: 'images/comics'.
rest := str throughAll: '>'.
contentBlock value: writer value: rest.
writer endItem.
writer endChannel.
writer endRSS]
ensure: [out close].
Read: Another useful script