16 lines
521 B
Smalltalk
16 lines
521 B
Smalltalk
accessing
|
|
collectRawTweetsForPages: anInteger
|
|
|
|
| pagesDict rawResponse response |
|
|
pagesDict := self pageURLs: anInteger.
|
|
rawResponse := OrderedCollection new.
|
|
pagesDict values do: [ :each |
|
|
rawResponse addAll: ((each xpath: '//div[@class="timeline-item "]') asOrderedCollection
|
|
collect: [ :xmlElement | xmlElement postCopy ])
|
|
|
|
].
|
|
response := TweetsCollection new.
|
|
response query: pagesDict keys.
|
|
response tweets: (rawResponse collect: [ :tweet | Tweet new fromNitterHtmlItem: tweet ]).
|
|
^ response.
|
|
|