18 lines
565 B
Smalltalk
18 lines
565 B
Smalltalk
accessing
|
|
collectRawTweetsForPages: anInteger
|
|
|
|
| pagesDict response |
|
|
pagesDict := self getPagesContentsUntil: anInteger.
|
|
response := TweetsCollection new.
|
|
response query: pagesDict keys.
|
|
pagesDict keysAndValuesDo: [ :key :rawTweets | | temp |
|
|
temp := (rawTweets xpath: '//div[@class="timeline-item "]') asOrderedCollection
|
|
collect: [ :xmlElement | xmlElement postCopy ].
|
|
temp do: [ :tweet | | tempTweet |
|
|
tempTweet := Tweet new fromNitterHtmlItem: tweet.
|
|
tempTweet queries add: key.
|
|
response tweets add: tempTweet.
|
|
]
|
|
].
|
|
^ response.
|
|
|