Socialmetrica/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st

10 lines
352 B
Smalltalk
Raw Normal View History

2022-05-04 01:50:20 +00:00
accessing
newestOf: userName
2022-05-04 01:50:20 +00:00
| user |
user := (TwitterUser storedInstances select: [ :each | each userName = userName ]) first.
2022-05-04 01:50:20 +00:00
self messages ifNil: [ ^ nil ].
self messages ifEmpty: [ ^ nil ].
user messages: self.
^ ((user tweets)
select: [ :tweet | tweet created = ((self collect: [ :each | each created ]) asSortedCollection last)]) first.