Extra initializer to support new data narratives.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-07-15 11:13:03 -05:00
parent 7bb4d66d57
commit ff72e94bb5

View File

@ -0,0 +1,12 @@
accessing
fromUserName: twitterName andId: numericString
| tweet |
tweet := self new.
^ Tweet storedInstances detect: [ :each | each id = numericString ]
ifNone: [ | tweetUrl xmlTweet |
tweetUrl := NitterUser nitterProvider, twitterName, '/status/', numericString.
xmlTweet := (NitterUser new documentTreeFor: tweetUrl)
xpath: '//div[@class="main-tweet"]'.
^ xmlTweet
].