Socialmetrica/Socialmetrica.package/Tweet.class/class/fromUserName.andId..st

12 lines
396 B
Smalltalk
Raw Normal View History

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
].