2022-04-11 16:42:54 +00:00
|
|
|
accessing
|
|
|
|
fromNitterHtmlItem: xmlItem
|
|
|
|
|
|
|
|
| author authorAndId timeTemp |
|
|
|
|
authorAndId := (((xmlItem xpath: '//a[@class="tweet-link"]') asString
|
|
|
|
splitOn: 'href="') second splitOn: '/') reject: [
|
|
|
|
:i | i isEmpty or: [ i = '>)' ] ].
|
|
|
|
author := authorAndId first.
|
|
|
|
user := NitterUser new userName: author.
|
|
|
|
timeTemp := (((xmlItem xpath: '//span[@class="tweet-date"]') asString
|
|
|
|
splitOn: 'title="') second splitOn: '">') first.
|
|
|
|
timeTemp := ((timeTemp copyReplaceAll: ' · ' with: ' ')
|
|
|
|
copyReplaceAll: 'UTC'
|
|
|
|
with: '+00:00') asDateAndTime.
|
|
|
|
created := timeTemp.
|
2022-04-12 23:13:31 +00:00
|
|
|
text := ((xmlItem xpath: '//div[@class="tweet-content media-body"]') asString allButLast)
|
|
|
|
copyReplaceAll: 'a XPathNodeSet(' with: '' .
|
2022-04-11 16:42:54 +00:00
|
|
|
id := authorAndId last copyReplaceAll: '#m"' with: ''.
|
|
|
|
authorId := self user id.
|
|
|
|
self metricsFromNitterHtml: xmlItem
|