Skip to content

Instantly share code, notes, and snippets.

@draegtun
Created December 11, 2017 16:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save draegtun/5093f97c63b26ef533705edf61a78dc0 to your computer and use it in GitHub Desktop.
Save draegtun/5093f97c63b26ef533705edf61a78dc0 to your computer and use it in GitHub Desktop.
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