diff --git a/Socialmetrica.package/NitterUser.class/instance/newestTweet.st b/Socialmetrica.package/NitterUser.class/instance/newestTweet.st new file mode 100644 index 0000000..5a5dec1 --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/newestTweet.st @@ -0,0 +1,4 @@ +accessing +newestTweet + + ^ self messages newestOf: self id \ No newline at end of file diff --git a/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st b/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st new file mode 100644 index 0000000..0a5e5ee --- /dev/null +++ b/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st @@ -0,0 +1,7 @@ +accessing +newestOf: userId + + self messages ifNil: [ ^ nil ]. + self messages ifEmpty: [ ^ nil ]. + ^ ((self select: [ :tweet | tweet authorId = userId ]) + select: [ :tweet | tweet created = (((self select: [ :each | each authorId = userId ]) collect: [ :each | each created ]) asSortedCollection last)]) first \ No newline at end of file