From f9b7fdf6bb52428fa6872ec37e9aa61db8d9d338 Mon Sep 17 00:00:00 2001 From: ruidajo Date: Sun, 15 May 2022 17:15:12 -0500 Subject: [PATCH] Modifying newest and oldest tweet selection. --- .../NitterUser.class/instance/newestTweet.st | 2 +- .../NitterUser.class/instance/oldestTweet.st | 2 +- .../NitterUser.class/instance/tweets.st | 11 +++++++++-- .../TweetsCollection.class/instance/newestOf..st | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Socialmetrica.package/NitterUser.class/instance/newestTweet.st b/Socialmetrica.package/NitterUser.class/instance/newestTweet.st index c2bda05..ed6ee8a 100644 --- a/Socialmetrica.package/NitterUser.class/instance/newestTweet.st +++ b/Socialmetrica.package/NitterUser.class/instance/newestTweet.st @@ -1,4 +1,4 @@ accessing newestTweet - ^ self messages newestOf: self userName \ No newline at end of file + ^ (self tweets select: [ :tweet | tweet created = ((self tweets collect: [ :each | each created ]) asSortedCollection last)]) first. \ No newline at end of file diff --git a/Socialmetrica.package/NitterUser.class/instance/oldestTweet.st b/Socialmetrica.package/NitterUser.class/instance/oldestTweet.st index cfc926b..c0f793d 100644 --- a/Socialmetrica.package/NitterUser.class/instance/oldestTweet.st +++ b/Socialmetrica.package/NitterUser.class/instance/oldestTweet.st @@ -1,4 +1,4 @@ accessing oldestTweet - ^ self messages oldestOf: self userName \ No newline at end of file + ^ (self tweets select: [ :tweet | tweet created = ((self tweets collect: [ :each | each created ]) asSortedCollection first)]) first. \ No newline at end of file diff --git a/Socialmetrica.package/NitterUser.class/instance/tweets.st b/Socialmetrica.package/NitterUser.class/instance/tweets.st index 103512b..d66d2b0 100644 --- a/Socialmetrica.package/NitterUser.class/instance/tweets.st +++ b/Socialmetrica.package/NitterUser.class/instance/tweets.st @@ -13,8 +13,15 @@ tweets subcollection := self messages select: [ :each | (each authorId = '1502504562984374276') or: [ each authorId = self id ] ] ]. - (self userName ~= 'FranciaMarquezM' and: [ self userName ~= 'sandralajas' ]) - ifTrue: [ subcollection := self messages select: [ :each | each authorId = self id ] ]. + self userName = 'IBetancourtCol' + ifTrue: [ + subcollection := self messages + select: [ :each | (each authorId = '1517487571135344643') or: [ each authorId = self id ] ] + ]. + (self userName ~= 'FranciaMarquezM' and: [ self userName ~= 'sandralajas' ]) + ifTrue: [ self userName ~= 'IBetancourtCol' ifTrue: + [ subcollection := self messages select: [ :each | each authorId = self id ]] + ]. ^ TweetsCollection new messages: subcollection; yourself \ No newline at end of file diff --git a/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st b/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st index 560d74d..e070077 100644 --- a/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st +++ b/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st @@ -5,5 +5,6 @@ newestOf: userName user := (TwitterUser storedInstances select: [ :each | each userName = userName ]) first. self messages ifNil: [ ^ nil ]. self messages ifEmpty: [ ^ nil ]. - ^ ((user messages: self; yourself; tweets) + user messages: self. + ^ ((user tweets) select: [ :tweet | tweet created = ((self collect: [ :each | each created ]) asSortedCollection last)]) first. \ No newline at end of file