Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example Smalltalk code for SO
| session data |
session := ZnClient new url: 'http://cloud-storage.com'.
"Login"
session path: '/login';
formAt: 'email' put: 'jom';
formAt: 'password' put: 'mypass';
post.
"Get data"
data := session path: '/my-file'; get; contents.
"Check for new data every 60 secs for maximum 100 tries"
[
100 timesRepeat: [
| newData |
(Delay forSeconds: 60) wait.
newData := session path: '/my-file'; get; contents.
(data ~= newData) ifTrue: [Transcript show: newData; cr]
]
] fork.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment