From 7717f00185522e646c4d761b2b7fef53db0f9493 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 15 May 2022 13:51:33 -0500 Subject: [PATCH] Tweets scraping: updating from web until the most recently stored. --- .../NitterUser.class/instance/updatedTweets.st | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Socialmetrica.package/NitterUser.class/instance/updatedTweets.st diff --git a/Socialmetrica.package/NitterUser.class/instance/updatedTweets.st b/Socialmetrica.package/NitterUser.class/instance/updatedTweets.st new file mode 100644 index 0000000..0c6488e --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/updatedTweets.st @@ -0,0 +1,11 @@ +accessing +updatedTweets + | currentTweetsPage response nextPageCursor | + + currentTweetsPage := self collectRawTweetsFrom: self userNameLinkWithReplies upToPage: 2. + [ (currentTweetsPage collect: [ :tweet | tweet id ]) includes: self newestTweet id ] whileFalse: [ + response addAll: currentTweetsPage. + nextPageCursor := currentTweetsPage nextCursor. + currentTweetsPage := self collectRawTweetsFrom: nextPageCursor upToPage: 2. + ]. + ^ response \ No newline at end of file