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

View File

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