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

16 lines
521 B
Smalltalk
Raw Normal View History

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.