DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Polls For Updates To A Website And Plays A Sound If Change Is Found.

04.07.2005
| 3144 views |
  • submit to reddit
        | oldContent newContent |
oldContent _ nil.
[[Smalltalk at: #Stop ifAbsent:[true]] whileTrue: [
newContent _ 'http://minnow.cc.gatech.edu/squeak/recent' asUrl
retrieveContents contents.
(oldContent ~= newContent) ifTrue:[
(FMSound majorChordOn: FMSound flute1 from: #c4) play.
oldContent _ newContent
].
(Delay forSeconds:  30) wait.
]] forkAt: Processor userBackgroundPriority