Now each tweet stores metadata about the Nitter timeline where it appears.
This commit is contained in:
parent
db1a8e0502
commit
9b99ed0e33
@ -1,16 +1,18 @@
|
|||||||
accessing
|
accessing
|
||||||
collectRawTweetsForPages: anInteger
|
collectRawTweetsForPages: anInteger
|
||||||
|
|
||||||
| pagesDict rawResponse response |
|
| pagesDict response |
|
||||||
pagesDict := self pageURLs: anInteger.
|
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 := TweetsCollection new.
|
||||||
response query: pagesDict keys.
|
response query: pagesDict keys.
|
||||||
response tweets: (rawResponse collect: [ :tweet | Tweet new fromNitterHtmlItem: tweet ]).
|
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.
|
^ response.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user