Fixing connection to ReStore DB in tweets collection.

This commit is contained in:
ruidajo 2022-04-14 16:43:31 -05:00
parent 02ab2bd74a
commit b9eedc6ec3
3 changed files with 12 additions and 7 deletions

View File

@ -2,8 +2,8 @@ accessing
externalWordCloud
| text outputFile |
outputFile := (self folder / 'nube.png')fullName.
text := (self folder / self userName, 'words', 'txt')fullName.
outputFile := (self folder / 'nube.png') fullName.
text := (self folder / 'words', 'txt') fullName.
OSSUnixSubprocess new
command: 'wordcloud_cli';
arguments: { '--text' . text .

View File

@ -1,12 +1,15 @@
accessing
getLocalMessages
"TO DO! This method should return messages from the local database"
| allTweets myTweets |
| allTweets myTweets tempTweets tempUsername |
tempUsername := self userName.
TweetsCollection storeDB.
allTweets := Tweet storedInstances asOrderedCollection.
allTweets ifNil: [ ^ nil ].
myTweets := TweetsCollection new.
myTweets tweets: (allTweets select: [ :each | each timelines isNotEmpty and: [each timelines keys first = self userName] ] ).
tempTweets := allTweets select: [ :each | each timelines isNotEmpty and: [each timelines keys first = tempUsername] ].
myTweets tweets: tempTweets.
self tweets: myTweets.
^ self tweets
^ {self tweets. self userName. tempTweets}

View File

@ -1,5 +1,7 @@
accessing
storeDB
| localDBFile |
| localDBFile localDBConnection |
localDBFile := FileLocator userData / 'Socialmetrica' / 'socialmetrica.sqlite'.
^ ReStore connection: (SSWSQLite3Connection on: localDBFile fullName).
localDBConnection := ReStore connection: (SSWSQLite3Connection on: localDBFile fullName).
localDBConnection isConnected ifFalse: [ ^ localDBConnection connect ].
^ localDBConnection