2021-08-12 15:31:55 +00:00
|
|
|
accessing
|
|
|
|
messagesAuthors
|
2021-08-20 03:43:03 +00:00
|
|
|
| groupedTweets |
|
2021-08-12 15:31:55 +00:00
|
|
|
self includes at: 'users' ifAbsent: [ ^ nil ].
|
2021-08-20 03:43:03 +00:00
|
|
|
groupedTweets := self data groupedBy: [:each | each at: 'author_id' ].
|
|
|
|
^ (self includes at: 'users') collect: [:userDict | | user |
|
|
|
|
user := TwitterUser new fromDictionary: userDict.
|
2021-08-22 00:47:09 +00:00
|
|
|
(groupedTweets at: (user id)) do: [:tweetDict | | currentTweet |
|
|
|
|
currentTweet := Tweet new fromDictionary: tweetDict.
|
|
|
|
currentTweet user: user.
|
|
|
|
user tweets add: currentTweet.
|
2021-08-20 03:43:03 +00:00
|
|
|
].
|
|
|
|
user.
|
2021-08-12 15:31:55 +00:00
|
|
|
]
|