18 lines
552 B
Smalltalk
18 lines
552 B
Smalltalk
accessing
|
|
collectRawTweetsForPages: anInteger
|
|
|
|
| pagesDict response |
|
|
pagesDict := self pageURLs: 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.
|
|
|