diff --git a/Socialmetrica.package/NitterUser.class/instance/collectRawTweetsForPages..st b/Socialmetrica.package/NitterUser.class/instance/collectRawTweetsForPages..st index 59b5494..ce5dbac 100644 --- a/Socialmetrica.package/NitterUser.class/instance/collectRawTweetsForPages..st +++ b/Socialmetrica.package/NitterUser.class/instance/collectRawTweetsForPages..st @@ -1,16 +1,18 @@ accessing collectRawTweetsForPages: anInteger - | pagesDict rawResponse response | + | pagesDict 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 ]). + 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. \ No newline at end of file