diff --git a/Socialmetrica.package/NitterUser.class/instance/externalWordCloud.st b/Socialmetrica.package/NitterUser.class/instance/externalWordCloud.st index 58841cb..255a292 100644 --- a/Socialmetrica.package/NitterUser.class/instance/externalWordCloud.st +++ b/Socialmetrica.package/NitterUser.class/instance/externalWordCloud.st @@ -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 . diff --git a/Socialmetrica.package/NitterUser.class/instance/getLocalMessages.st b/Socialmetrica.package/NitterUser.class/instance/getLocalMessages.st index cceab00..ecbe26d 100644 --- a/Socialmetrica.package/NitterUser.class/instance/getLocalMessages.st +++ b/Socialmetrica.package/NitterUser.class/instance/getLocalMessages.st @@ -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} \ No newline at end of file diff --git a/Socialmetrica.package/TweetsCollection.class/class/storeDB.st b/Socialmetrica.package/TweetsCollection.class/class/storeDB.st index bc5da22..b09430e 100644 --- a/Socialmetrica.package/TweetsCollection.class/class/storeDB.st +++ b/Socialmetrica.package/TweetsCollection.class/class/storeDB.st @@ -1,5 +1,7 @@ accessing storeDB - | localDBFile | + | localDBFile localDBConnection | localDBFile := FileLocator userData / 'Socialmetrica' / 'socialmetrica.sqlite'. - ^ ReStore connection: (SSWSQLite3Connection on: localDBFile fullName). \ No newline at end of file + localDBConnection := ReStore connection: (SSWSQLite3Connection on: localDBFile fullName). + localDBConnection isConnected ifFalse: [ ^ localDBConnection connect ]. + ^ localDBConnection \ No newline at end of file