New TO DO annotations and improving formating.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-12 10:15:24 -05:00
parent 9b99ed0e33
commit 52b90dd8dd
2 changed files with 16 additions and 22 deletions

View File

@ -1,30 +1,24 @@
accessing
metricsFromNitterHtml: xmlItem
"TO DO: Metrics scrapping are not consistent.
Most times they store numbers, but sometimes, retweets store a userName"
self metrics
at: 'comment'
put:
(((xmlItem xpath: '//div[@class="icon-container"]') select: [ :item |
item asString includesSubstring: 'comment' ]) stringValue
trimmed copyReplaceAll: ',' with: '');
put: (((xmlItem xpath: '//div[@class="icon-container"]')
select: [ :item | item asString includesSubstring: 'comment' ])
stringValue trimmed copyReplaceAll: ',' with: '');
at: 'retweet'
put:
(((xmlItem xpath: '//div[@class="icon-container"]') select: [ :item |
item asString includesSubstring: 'retweet' ]) stringValue
trimmed copyReplaceAll: ',' with: '');
put: (((xmlItem xpath: '//div[@class="icon-container"]')
select: [ :item | item asString includesSubstring: 'retweet' ])
stringValue trimmed copyReplaceAll: ',' with: '');
at: 'quote'
put:
(((xmlItem xpath: '//div[@class="icon-container"]') select: [ :item |
item asString includesSubstring: 'quote' ]) stringValue trimmed
copyReplaceAll: ','
with: '');
put: (((xmlItem xpath: '//div[@class="icon-container"]')
select: [ :item | item asString includesSubstring: 'quote' ])
stringValue trimmed copyReplaceAll: ',' with: '');
at: 'heart'
put:
(((xmlItem xpath: '//div[@class="icon-container"]') select: [ :item |
item asString includesSubstring: 'heart' ]) stringValue trimmed
copyReplaceAll: ','
with: '').
put: (((xmlItem xpath: '//div[@class="icon-container"]')
select: [ :item | item asString includesSubstring: 'heart' ])
stringValue trimmed copyReplaceAll: ',' with: '').
self metadata
at: 'pinned'
put: (xmlItem xpath: '//div[@class="pinned"]') stringValue trimmed = 'Pinned Tweet'

View File

@ -2,7 +2,7 @@ accessing
store
ReStore isConnected ifFalse: [ self class storeDB]. "Starting the ReStore singleton."
self tweets do: [:each | ReStore evaluateAsTransaction: [
each store.
"each user id isInDB? ifFalse: [ each user store ]"
"TO DO: each isNotInDB ->"each store.
"TO DO: each user id isInDB? ifFalse: [ each user store ]"
]
].