2022-04-18 23:44:52 +00:00
|
|
|
accessing
|
|
|
|
metadataFromNitterHtml: xmlItem
|
2022-04-19 03:14:17 +00:00
|
|
|
| quoteSubtree |
|
2022-04-18 23:44:52 +00:00
|
|
|
|
|
|
|
self metadata
|
|
|
|
at: 'pinned'
|
|
|
|
put: (xmlItem xpath: '//div[@class="pinned"]') stringValue trimmed
|
|
|
|
= 'Pinned Tweet';
|
2022-04-19 03:14:17 +00:00
|
|
|
at: 'replie to'
|
|
|
|
put: (xmlItem xpath: '//div[@class="tweet-body"]//div[@class="replying-to"]') stringValue trimmed.
|
|
|
|
quoteSubtree := xmlItem xpath: '//div[@class="tweet-body"]//div[@class="quote quote-big"]//a[@class="quote-link"]'.
|
|
|
|
quoteSubtree set isEmpty
|
|
|
|
ifTrue: [ self metadata at: 'quote' put: '' ]
|
|
|
|
ifFalse: [
|
|
|
|
self metadata
|
|
|
|
at: 'quote'
|
|
|
|
put: ((quoteSubtree postCopy asString splitOn: 'href="/')
|
|
|
|
second removeSuffix: '"/>)')
|
|
|
|
]
|