diff --git a/Datanalitica.package/TwitterAPI.class/instance/gtUsersMentioning.On..st b/Datanalitica.package/TwitterAPI.class/instance/gtUsersMentioning.On..st deleted file mode 100644 index 4261aa2..0000000 --- a/Datanalitica.package/TwitterAPI.class/instance/gtUsersMentioning.On..st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -gtUsersMentioning: userName On: aView - - ^ aView columnedList - title: 'Users mentioning @',userName translated; - priority: 5; - items: [ self usersMentioning: userName ]; - column: 'Imagen' - icon: [ :aTwitterUser | aTwitterUser profileImage asElement asScalableElement size: 32 @ 32 ] - width: 75; - column: 'User Name' text: [ :aTwitterUser | aTwitterUser userName ]; - column: 'Name' text: [ :aTwitterUser | aTwitterUser name ] \ No newline at end of file diff --git a/Datanalitica.package/TwitterAPI.class/instance/userEndPointFor.selecting..st b/Datanalitica.package/TwitterAPI.class/instance/userEndPointFor.selecting..st index 13c07a8..d3318e7 100644 --- a/Datanalitica.package/TwitterAPI.class/instance/userEndPointFor.selecting..st +++ b/Datanalitica.package/TwitterAPI.class/instance/userEndPointFor.selecting..st @@ -2,6 +2,7 @@ accessing userEndPointFor: username selecting: tweetsOrMentions "I build a shared URL for querying last 100 mentions or tweets for a particular user. Second parameter should be only 'tweets' or 'mentions', dateString, if present, should be YYYY-MM-DD." - | commonQueryParameters | - commonQueryParameters := '?expansions=author_id&tweet.fields=conversation_id,created_at&user.fields=username,name,profile_image_url&max_results=100'. + | commonQueryParameters userFields | + userFields := 'user.fields=username,name,description,profile_image_url'. + commonQueryParameters := '?expansions=author_id&tweet.fields=conversation_id,created_at&', userFields, '&max_results=100'. ^ self usersBaseEndPoint, (self userIDFrom: username), '/', tweetsOrMentions, commonQueryParameters \ No newline at end of file diff --git a/Datanalitica.package/TwitterAPI.class/instance/usersGroupMentioning..st b/Datanalitica.package/TwitterAPI.class/instance/usersGroupMentioning..st new file mode 100644 index 0000000..25e9cbd --- /dev/null +++ b/Datanalitica.package/TwitterAPI.class/instance/usersGroupMentioning..st @@ -0,0 +1,5 @@ +accessing +usersGroupMentioning: userName + ^ TwitterUsersGroup new + users: (self usersMentioning: userName); + title: 'Users mentioning @', userName \ 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 770e69b..8490f7a 100644 --- a/Datanalitica.package/TwitterAPIResponse.class/instance/messagesAuthors.st +++ b/Datanalitica.package/TwitterAPIResponse.class/instance/messagesAuthors.st @@ -1,6 +1,12 @@ accessing messagesAuthors + | groupedTweets | self includes at: 'users' ifAbsent: [ ^ nil ]. - ^ (self includes at: 'users') collect: [:userDict | - TwitterUser new fromDictionary: userDict + 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) + ]. + user. ] \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/description.st b/Datanalitica.package/TwitterUser.class/instance/description.st new file mode 100644 index 0000000..c5ddede --- /dev/null +++ b/Datanalitica.package/TwitterUser.class/instance/description.st @@ -0,0 +1,3 @@ +accessing +description + ^ description \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/fromDictionary..st b/Datanalitica.package/TwitterUser.class/instance/fromDictionary..st index 8c55491..31bc9e0 100644 --- a/Datanalitica.package/TwitterUser.class/instance/fromDictionary..st +++ b/Datanalitica.package/TwitterUser.class/instance/fromDictionary..st @@ -3,4 +3,5 @@ fromDictionary: userDict id := userDict at: 'id'. name := userDict at: 'name'. userName := userDict at: 'username'. - profileImageUrl := userDict at: 'profile_image_url'. \ No newline at end of file + profileImageUrl := userDict at: 'profile_image_url'. + description := userDict at: 'description'. \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/gtViewContactDetailsOn..st b/Datanalitica.package/TwitterUser.class/instance/gtViewContactDetailsOn..st index 384acd6..9d4d6cb 100644 --- a/Datanalitica.package/TwitterUser.class/instance/gtViewContactDetailsOn..st +++ b/Datanalitica.package/TwitterUser.class/instance/gtViewContactDetailsOn..st @@ -9,6 +9,7 @@ gtViewContactDetailsOn: aView details := String streamContents: [:aStream | aStream nextPutAll: self name. aStream cr. + aStream nextPutAll: self description. ]. container := BlElement new diff --git a/Datanalitica.package/TwitterUser.class/instance/id.st b/Datanalitica.package/TwitterUser.class/instance/id.st new file mode 100644 index 0000000..41241a3 --- /dev/null +++ b/Datanalitica.package/TwitterUser.class/instance/id.st @@ -0,0 +1,3 @@ +accessing +id + ^ id \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/metrics..st b/Datanalitica.package/TwitterUser.class/instance/metrics..st new file mode 100644 index 0000000..452c93c --- /dev/null +++ b/Datanalitica.package/TwitterUser.class/instance/metrics..st @@ -0,0 +1,3 @@ +accessing +metrics: aDictionary + metrics := aDictionary \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/metrics.st b/Datanalitica.package/TwitterUser.class/instance/metrics.st new file mode 100644 index 0000000..1c190cd --- /dev/null +++ b/Datanalitica.package/TwitterUser.class/instance/metrics.st @@ -0,0 +1,3 @@ +accessing +metrics + ^ metrics ifNil: [ metrics := Dictionary new] \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/tweets..st b/Datanalitica.package/TwitterUser.class/instance/tweets..st new file mode 100644 index 0000000..27e07ae --- /dev/null +++ b/Datanalitica.package/TwitterUser.class/instance/tweets..st @@ -0,0 +1,3 @@ +accessing +tweets: aTweetsCollection + tweets := aTweetsCollection \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/tweets.st b/Datanalitica.package/TwitterUser.class/instance/tweets.st new file mode 100644 index 0000000..b2a337f --- /dev/null +++ b/Datanalitica.package/TwitterUser.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/TwitterUser.class/properties.json b/Datanalitica.package/TwitterUser.class/properties.json index 416c7f7..2912f8f 100644 --- a/Datanalitica.package/TwitterUser.class/properties.json +++ b/Datanalitica.package/TwitterUser.class/properties.json @@ -9,7 +9,10 @@ "id", "name", "userName", - "profileImageUrl" + "profileImageUrl", + "description", + "metrics", + "tweets" ], "name" : "TwitterUser", "type" : "normal" diff --git a/Datanalitica.package/TwitterUsersGroup.class/instance/gtTwitterUsersGroupOn..st b/Datanalitica.package/TwitterUsersGroup.class/instance/gtTwitterUsersGroupOn..st new file mode 100644 index 0000000..4b855ff --- /dev/null +++ b/Datanalitica.package/TwitterUsersGroup.class/instance/gtTwitterUsersGroupOn..st @@ -0,0 +1,13 @@ +accessing +gtTwitterUsersGroupOn: aView + + ^ aView columnedList + title: self title translated; + priority: 5; + items: [ self users ]; + column: 'Imagen' + icon: [ :aTwitterUser | aTwitterUser profileImage asElement asScalableElement size: 32 @ 32 ] + width: 75; + column: 'User Name' text: [ :aTwitterUser | '@', aTwitterUser userName ]; + column: 'Name' text: [ :aTwitterUser | aTwitterUser name ]; + column: 'Mentions' text: [ :aTwitterUser | aTwitterUser tweets size asString ] \ No newline at end of file diff --git a/Datanalitica.package/TwitterUsersGroup.class/instance/gtUsersMentioningOn..st b/Datanalitica.package/TwitterUsersGroup.class/instance/gtUsersMentioningOn..st deleted file mode 100644 index 9101043..0000000 --- a/Datanalitica.package/TwitterUsersGroup.class/instance/gtUsersMentioningOn..st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -gtUsersMentioningOn: aView - - ^ aView columnedList - title: self title translated; - priority: 5; - items: [ self users ]; - column: 'Imagen' - icon: [ :aTwitterUser | aTwitterUser profileImage asElement asScalableElement size: 32 @ 32 ] - width: 75; - column: 'User Name' text: [ :aTwitterUser | aTwitterUser userName ]; - column: 'Name' text: [ :aTwitterUser | aTwitterUser name ] \ No newline at end of file