Created
December 11, 2017 16:15
-
-
Save draegtun/5093f97c63b26ef533705edf61a78dc0 to your computer and use it in GitHub Desktop.
Example Smalltalk code for SO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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