Socialmetrica/Socialmetrica.package/NitterUser.class/instance/getPagesContentsUntil..st

18 lines
769 B
Smalltalk
Raw Normal View History

accessing
getPagesContentsUntil: 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?
or do we always be getting the cursor urls and its contents all the time.
[ ] Benchmark alternative approaches."
| response nextPageLink previousPageLink |
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.
previousPageLink := nextPageLink
].
^ response