Minor fix in quotes scraping.
This commit is contained in:
parent
2383ea4459
commit
c2078d032f
@ -1,14 +1,19 @@
|
||||
accessing
|
||||
metadataFromNitterHtml: xmlItem
|
||||
| quoteSubtree |
|
||||
|
||||
self metadata
|
||||
at: 'pinned'
|
||||
put: (xmlItem xpath: '//div[@class="pinned"]') stringValue trimmed
|
||||
= 'Pinned Tweet';
|
||||
at: 'replie to' put: (xmlItem xpath:
|
||||
'//div[@class="tweet-body"]//div[@class="replying-to"]')
|
||||
stringValue trimmed;
|
||||
at: 'quote' put: (((xmlItem xpath:
|
||||
'//div[@class="tweet-body"]//div[@class="quote quote-big"]//a[@class="quote-link"]')
|
||||
postCopy asString splitOn: 'href="/') second removeSuffix:
|
||||
'"/>)')
|
||||
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: '"/>)')
|
||||
]
|
Loading…
Reference in New Issue
Block a user