From a08073232d9f02a2d2b828056d0d3a1a16789c3a Mon Sep 17 00:00:00 2001 From: ruidajo Date: Tue, 3 May 2022 20:50:20 -0500 Subject: [PATCH] Modifying newest tweet selection. --- .../NitterUser.class/instance/newestTweet.st | 4 ++++ .../TweetsCollection.class/instance/newestOf..st | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 Socialmetrica.package/NitterUser.class/instance/newestTweet.st create mode 100644 Socialmetrica.package/TweetsCollection.class/instance/newestOf..st 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