Complete 2. challenge
This commit is contained in:
19
src/MyCounter/Challenge0.class.st
Normal file
19
src/MyCounter/Challenge0.class.st
Normal file
@@ -0,0 +1,19 @@
|
||||
Class {
|
||||
#name : #Challenge0,
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'response'
|
||||
],
|
||||
#category : #MyCounter
|
||||
}
|
||||
|
||||
{ #category : #actions }
|
||||
Challenge0 >> fetch [
|
||||
|
||||
response := ZnEasy getPng: 'http://pharo.org/files/pharo.png'.
|
||||
]
|
||||
|
||||
{ #category : #actions }
|
||||
Challenge0 >> open [
|
||||
response asMorph openInWorld
|
||||
]
|
22
src/MyCounter/Challenge1.class.st
Normal file
22
src/MyCounter/Challenge1.class.st
Normal file
@@ -0,0 +1,22 @@
|
||||
Class {
|
||||
#name : #Challenge1,
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'response'
|
||||
],
|
||||
#category : #MyCounter
|
||||
}
|
||||
|
||||
{ #category : #actions }
|
||||
Challenge1 >> fetch [
|
||||
|email url asHex|
|
||||
email := MD5 new hashMessage: 'belka@caraus.de'.
|
||||
asHex := email hex asString.
|
||||
url := 'http://www.gravatar.com/avatar/', asHex, '.jpg'.
|
||||
response := ZnEasy getJpeg: url
|
||||
]
|
||||
|
||||
{ #category : #actions }
|
||||
Challenge1 >> open [
|
||||
response asMorph openInHand
|
||||
]
|
Reference in New Issue
Block a user