diff --git a/Datanalitica.package/Tweet.class/instance/asCardElement.st b/Datanalitica.package/Tweet.class/instance/asCardElement.st new file mode 100644 index 0000000..c259164 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/asCardElement.st @@ -0,0 +1,14 @@ +accessing +asCardElement + ^ BrHorizontalPane new + hFitContent; + vFitContent; + padding: (BlInsets all: 20); + margin: (BlInsets all: 10); + addChild: (self user profileImage asElement asScalableElement size: 64@64); + addChild: (BrVerticalPane new + fitContent; + margin: (BlInsets left: 20); + addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: self created); + addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: self text)); + when: BlClickEvent do: [:e | e target phlow spawnObject: self] \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/fromDictionary..st b/Datanalitica.package/Tweet.class/instance/fromDictionary..st index c05388c..cd755ce 100644 --- a/Datanalitica.package/Tweet.class/instance/fromDictionary..st +++ b/Datanalitica.package/Tweet.class/instance/fromDictionary..st @@ -4,6 +4,6 @@ fromDictionary: aDictionary text := aDictionary at: 'text'. id := aDictionary at: 'id'. authorId := aDictionary at: 'author_id'. - username := aDictionary at: 'username' ifAbsent: [''] . + user := aDictionary at: 'username' ifAbsent: [''] . conversationId := aDictionary at: 'conversation_id' ifAbsent: [ '' ]. ^ self \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/user..st b/Datanalitica.package/Tweet.class/instance/user..st new file mode 100644 index 0000000..ccfbb78 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/user..st @@ -0,0 +1,3 @@ +accessing +user: aTwitterUser + user := aTwitterUser \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/user.st b/Datanalitica.package/Tweet.class/instance/user.st new file mode 100644 index 0000000..362421a --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/user.st @@ -0,0 +1,3 @@ +accessing +user + ^ user \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/properties.json b/Datanalitica.package/Tweet.class/properties.json index 3951199..15b71c6 100644 --- a/Datanalitica.package/Tweet.class/properties.json +++ b/Datanalitica.package/Tweet.class/properties.json @@ -11,7 +11,7 @@ "id", "authorId", "conversationId", - "username" + "user" ], "name" : "Tweet", "type" : "normal" diff --git a/Datanalitica.package/TweetsCollection.class/README.md b/Datanalitica.package/TweetsCollection.class/README.md new file mode 100644 index 0000000..e69de29 diff --git a/Datanalitica.package/TweetsCollection.class/instance/add..st b/Datanalitica.package/TweetsCollection.class/instance/add..st new file mode 100644 index 0000000..2bd096e --- /dev/null +++ b/Datanalitica.package/TweetsCollection.class/instance/add..st @@ -0,0 +1,3 @@ +accessing +add: aTweet + self tweets add: aTweet \ No newline at end of file diff --git a/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st b/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st new file mode 100644 index 0000000..ea6ee64 --- /dev/null +++ b/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st @@ -0,0 +1,26 @@ +accessing +gtTweetsFor: aView + + ^ aView explicit + title: 'Tweets'; + stencil: [ + | container imageContainer | + container := BlElement new + layout: BlFlowLayout new; + constraintsDo: [ :c | + c vertical fitContent. + c horizontal matchParent ]; + padding: (BlInsets all: 10). + self tweets do: [ :each | + imageContainer := BlLazyElement new + withGlamorousPreview; + aptitude: BrShadowAptitude new; + background: Color white; + + margin: (BlInsets all: 20); + constraintsDo: [ :c | + c vertical exact: 100. + c horizontal exact: 1000 ]; + elementBuilder: [ each asCardElement margin: (BlInsets all: 20) ]. + container addChild: imageContainer]. + container asScrollableElement ] \ No newline at end of file diff --git a/Datanalitica.package/TweetsCollection.class/instance/printOn..st b/Datanalitica.package/TweetsCollection.class/instance/printOn..st new file mode 100644 index 0000000..d864500 --- /dev/null +++ b/Datanalitica.package/TweetsCollection.class/instance/printOn..st @@ -0,0 +1,5 @@ +accessing +printOn: aStream + super printOn: aStream. + aStream + nextPutAll: '( ',self size asString, ' Tweet(s) )' \ No newline at end of file diff --git a/Datanalitica.package/TweetsCollection.class/instance/size.st b/Datanalitica.package/TweetsCollection.class/instance/size.st new file mode 100644 index 0000000..c2cdbcc --- /dev/null +++ b/Datanalitica.package/TweetsCollection.class/instance/size.st @@ -0,0 +1,3 @@ +accessing +size + ^ self tweets size \ No newline at end of file diff --git a/Datanalitica.package/TweetsCollection.class/instance/tweets..st b/Datanalitica.package/TweetsCollection.class/instance/tweets..st new file mode 100644 index 0000000..1361d1b --- /dev/null +++ b/Datanalitica.package/TweetsCollection.class/instance/tweets..st @@ -0,0 +1,3 @@ +accessing +tweets: aTweetsCollection + ^ tweets := aTweetsCollection \ No newline at end of file diff --git a/Datanalitica.package/TweetsCollection.class/instance/tweets.st b/Datanalitica.package/TweetsCollection.class/instance/tweets.st new file mode 100644 index 0000000..b2a337f --- /dev/null +++ b/Datanalitica.package/TweetsCollection.class/instance/tweets.st @@ -0,0 +1,3 @@ +accessing +tweets + ^ tweets ifNil: [ tweets := OrderedCollection new] \ No newline at end of file diff --git a/Datanalitica.package/TweetsCollection.class/properties.json b/Datanalitica.package/TweetsCollection.class/properties.json new file mode 100644 index 0000000..7de3d85 --- /dev/null +++ b/Datanalitica.package/TweetsCollection.class/properties.json @@ -0,0 +1,13 @@ +{ + "commentStamp" : "", + "super" : "Object", + "category" : "Datanalitica-Datanalitica", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ + "tweets" + ], + "name" : "TweetsCollection", + "type" : "normal" +} \ No newline at end of file diff --git a/Datanalitica.package/TwitterAPIResponse.class/instance/messagesAuthors.st b/Datanalitica.package/TwitterAPIResponse.class/instance/messagesAuthors.st index 8490f7a..3eff33f 100644 --- a/Datanalitica.package/TwitterAPIResponse.class/instance/messagesAuthors.st +++ b/Datanalitica.package/TwitterAPIResponse.class/instance/messagesAuthors.st @@ -5,8 +5,10 @@ messagesAuthors groupedTweets := self data groupedBy: [:each | each at: 'author_id' ]. ^ (self includes at: 'users') collect: [:userDict | | user | user := TwitterUser new fromDictionary: userDict. - (groupedTweets at: (user id)) do: [:tweetDict | - user tweets add: (Tweet new fromDictionary: tweetDict) + (groupedTweets at: (user id)) do: [:tweetDict | | currentTweet | + currentTweet := Tweet new fromDictionary: tweetDict. + currentTweet user: user. + user tweets add: currentTweet. ]. user. ] \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/gtViewContactDetailsOn..st b/Datanalitica.package/TwitterUser.class/instance/gtViewProfileDetailsOn..st similarity index 97% rename from Datanalitica.package/TwitterUser.class/instance/gtViewContactDetailsOn..st rename to Datanalitica.package/TwitterUser.class/instance/gtViewProfileDetailsOn..st index 9d4d6cb..3704d53 100644 --- a/Datanalitica.package/TwitterUser.class/instance/gtViewContactDetailsOn..st +++ b/Datanalitica.package/TwitterUser.class/instance/gtViewProfileDetailsOn..st @@ -1,5 +1,5 @@ accessing -gtViewContactDetailsOn: aView +gtViewProfileDetailsOn: aView ^ aView explicit title: 'Details' translated; diff --git a/Datanalitica.package/TwitterUser.class/instance/profileImage.st b/Datanalitica.package/TwitterUser.class/instance/profileImage.st index 15aa5ff..06a59e6 100644 --- a/Datanalitica.package/TwitterUser.class/instance/profileImage.st +++ b/Datanalitica.package/TwitterUser.class/instance/profileImage.st @@ -4,13 +4,13 @@ profileImage response := ZnClient new url: (self profileImageUrl); get; response. response contentType = ZnMimeType imageJpeg ifTrue: [ | imageTemp | - imageTemp := [JPEGReadWriter gtFromBuffer: response contents]. + imageTemp := [ JPEGReadWriter gtFromBuffer: response contents ]. imageTemp on: Error do: [ ^ GtABContact new avatar ]. ^ imageTemp value asElement ]. response contentType = ZnMimeType imagePng ifTrue: [ | imageTemp | - imageTemp := [PNGReadWriter gtFromBuffer: response contents]. + imageTemp := [ PNGReadWriter gtFromBuffer: response contents ]. imageTemp on: Error do: [ ^ GtABContact new avatar ]. ^ imageTemp value asElement ]. diff --git a/Datanalitica.package/TwitterUser.class/instance/tweets.st b/Datanalitica.package/TwitterUser.class/instance/tweets.st index b2a337f..9a85747 100644 --- a/Datanalitica.package/TwitterUser.class/instance/tweets.st +++ b/Datanalitica.package/TwitterUser.class/instance/tweets.st @@ -1,3 +1,3 @@ accessing tweets - ^ tweets ifNil: [ tweets := OrderedCollection new] \ No newline at end of file + ^ tweets ifNil: [ tweets := TweetsCollection new] \ No newline at end of file