2022-04-11 16:42:54 +00:00
|
|
|
accessing
|
|
|
|
metricsFromNitterHtml: xmlItem
|
2022-04-12 15:15:24 +00:00
|
|
|
"TO DO: Metrics scrapping are not consistent.
|
|
|
|
Most times they store numbers, but sometimes, retweets store a userName"
|
2022-04-11 16:42:54 +00:00
|
|
|
self metrics
|
|
|
|
at: 'comment'
|
2022-04-12 23:13:31 +00:00
|
|
|
put: (((xmlItem xpath: '//div[@class="tweet-stats"]//div[@class="icon-container"]')
|
2022-04-12 15:15:24 +00:00
|
|
|
select: [ :item | item asString includesSubstring: 'comment' ])
|
|
|
|
stringValue trimmed copyReplaceAll: ',' with: '');
|
2022-04-11 16:42:54 +00:00
|
|
|
at: 'retweet'
|
2022-04-12 23:13:31 +00:00
|
|
|
put: (((xmlItem xpath: '//div[@class="tweet-stats"]//div[@class="icon-container"]')
|
2022-04-12 15:15:24 +00:00
|
|
|
select: [ :item | item asString includesSubstring: 'retweet' ])
|
|
|
|
stringValue trimmed copyReplaceAll: ',' with: '');
|
2022-04-11 16:42:54 +00:00
|
|
|
at: 'quote'
|
2022-04-12 23:13:31 +00:00
|
|
|
put: (((xmlItem xpath: '//div[@class="tweet-stats"]//div[@class="icon-container"]')
|
2022-04-12 15:15:24 +00:00
|
|
|
select: [ :item | item asString includesSubstring: 'quote' ])
|
|
|
|
stringValue trimmed copyReplaceAll: ',' with: '');
|
2022-04-11 16:42:54 +00:00
|
|
|
at: 'heart'
|
2022-04-12 23:13:31 +00:00
|
|
|
put: (((xmlItem xpath: '//div[@class="tweet-stats"]//div[@class="icon-container"]')
|
2022-04-12 15:15:24 +00:00
|
|
|
select: [ :item | item asString includesSubstring: 'heart' ])
|
|
|
|
stringValue trimmed copyReplaceAll: ',' with: '').
|
2022-04-11 19:18:52 +00:00
|
|
|
self metadata
|
2022-04-11 16:42:54 +00:00
|
|
|
at: 'pinned'
|
|
|
|
put: (xmlItem xpath: '//div[@class="pinned"]') stringValue trimmed = 'Pinned Tweet'
|