Improving nitter user getting pages.

This commit is contained in:
ruidajo 2022-04-12 16:05:59 -05:00
parent 2c61055b38
commit bcf67809a8
2 changed files with 6 additions and 5 deletions

View File

@ -2,7 +2,7 @@ accessing
collectRawTweetsForPages: anInteger
| pagesDict response |
pagesDict := self getPagesContentsUntil: anInteger.
pagesDict := self getPagesContentsUpto: anInteger.
response := TweetsCollection new.
response query: pagesDict keys.
pagesDict keysAndValuesDo: [ :key :rawTweets | | temp |

View File

@ -1,5 +1,5 @@
accessing
getPagesContentsUntil: anInteger
getPagesContentsUpto: anInteger
"I retroactively get all pages contents until a specified page number.
TO DO: should this be splitted back to two methods, one getting the page urls and other its content?
@ -10,9 +10,10 @@ getPagesContentsUntil: anInteger
response := OrderedDictionary new.
response at: self userNameLink put: self documentTree.
previousPageLink := self userNameLink.
anInteger - 1 timesRepeat: [
nextPageLink := self userNameLink, (self pageCursorFor:previousPageLink) keys first.
response at: nextPageLink put: (self pageCursorFor:previousPageLink) values first.
anInteger - 1 timesRepeat: [ | pageCursor |
pageCursor := self pageCursorFor:previousPageLink.
nextPageLink := self userNameLink, pageCursor keys first.
response at: nextPageLink put: pageCursor values first.
previousPageLink := nextPageLink
].
^ response