Storing several tweets.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-06 11:21:08 -05:00
parent a899ba9a9d
commit 062a0ac309
2 changed files with 7 additions and 9 deletions

View File

@ -0,0 +1,5 @@
accessing
storeDB
| localDBFile |
localDBFile := FileLocator userData / 'Socialmetrica' / 'socialmetrica.sqlite'.
^ ReStore connection: (SSWSQLite3Connection on: localDBFile fullName).

View File

@ -1,11 +1,4 @@
accessing
store
| localFolder parameters host profile |
parameters := self queryParameters .
host := parameters asUrl host.
profile := parameters asUrl segments first.
host = NitterUser nitterProvider asUrl host
ifFalse: [ ^ self ].
localFolder := (self dataStore / 'web' / 'twitter.com' / profile) ensureCreateDirectory.
self tweets do: [:each | each exportInto: localFolder ].
^ localFolder
self class storeDB. "Starting the ReStore singleton."
self tweets do: [:each | ReStore evaluateAsTransaction: [ each store ] ].