2022-04-11 19:18:52 +00:00
|
|
|
accessing
|
|
|
|
collectRawTweetsForPages: anInteger
|
|
|
|
|
2022-04-12 23:13:31 +00:00
|
|
|
| pagesDict response customQuery |
|
2022-04-12 21:05:59 +00:00
|
|
|
pagesDict := self getPagesContentsUpto: anInteger.
|
2022-04-11 19:18:52 +00:00
|
|
|
response := TweetsCollection new.
|
2022-04-12 23:13:31 +00:00
|
|
|
customQuery := Dictionary new
|
|
|
|
at: 'parameters' put: pagesDict keys;
|
|
|
|
at: 'date' put: DateAndTime now;
|
|
|
|
yourself.
|
|
|
|
response query: customQuery.
|
2022-04-12 01:46:22 +00:00
|
|
|
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.
|
2022-04-12 23:13:31 +00:00
|
|
|
tempTweet metadata
|
2022-04-12 23:23:08 +00:00
|
|
|
at: DateAndTime now asString put: key;
|
2022-04-12 23:13:31 +00:00
|
|
|
yourself.
|
2022-04-12 01:46:22 +00:00
|
|
|
response tweets add: tempTweet.
|
|
|
|
]
|
|
|
|
].
|
2022-04-12 23:13:31 +00:00
|
|
|
response tweets doWithIndex: [ :tweet :i |
|
|
|
|
| current previous |
|
|
|
|
current := response tweets at: i.
|
|
|
|
i < response tweets size ifTrue: [
|
|
|
|
previous := response tweets at: i + 1.
|
|
|
|
current timelines
|
|
|
|
at: self userName put: previous id;
|
|
|
|
yourself ]].
|
2022-04-11 19:18:52 +00:00
|
|
|
^ response.
|
|
|
|
|