From e98fd45083804439190fd21965c49184fe89c7d6 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 18 Apr 2022 18:36:52 -0500 Subject: [PATCH] Improving creation date processing/transfomation from different formats. #retrieveContents should also load local messages. --- .../NitterUser.class/instance/getLocalMessages.st | 2 +- .../NitterUser.class/instance/retrieveContents.st | 1 + .../NitterUser.class/instance/retrieveLocalContents.st | 5 ++++- Socialmetrica.package/Tweet.class/instance/created.st | 4 ++-- .../TwitterUser.class/instance/asCardElement.st | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Socialmetrica.package/NitterUser.class/instance/getLocalMessages.st b/Socialmetrica.package/NitterUser.class/instance/getLocalMessages.st index 8cf6ad5..9040efd 100644 --- a/Socialmetrica.package/NitterUser.class/instance/getLocalMessages.st +++ b/Socialmetrica.package/NitterUser.class/instance/getLocalMessages.st @@ -10,5 +10,5 @@ getLocalMessages tweetsWithAntecesor := allTweets select: [ :each | each timelines isNotEmpty and: [ each timelines keys first = self userName ]]. myTweets messages: tweetsWithAntecesor. self messages: myTweets. - ^ self messages + ^ self \ No newline at end of file diff --git a/Socialmetrica.package/NitterUser.class/instance/retrieveContents.st b/Socialmetrica.package/NitterUser.class/instance/retrieveContents.st index 1620063..9f894f1 100644 --- a/Socialmetrica.package/NitterUser.class/instance/retrieveContents.st +++ b/Socialmetrica.package/NitterUser.class/instance/retrieveContents.st @@ -1,6 +1,7 @@ accessing retrieveContents self userName ifNil: [^ self]. +" self retrieveLocalContents ifNotNil: [ ^ self ]." ^ self id; name; diff --git a/Socialmetrica.package/NitterUser.class/instance/retrieveLocalContents.st b/Socialmetrica.package/NitterUser.class/instance/retrieveLocalContents.st index 89b4f55..432e564 100644 --- a/Socialmetrica.package/NitterUser.class/instance/retrieveLocalContents.st +++ b/Socialmetrica.package/NitterUser.class/instance/retrieveLocalContents.st @@ -1,3 +1,6 @@ accessing retrieveLocalContents - ^ self class stored detect: [ :each | each userName = self userName ] \ No newline at end of file + | profileTemp | + profileTemp := self class stored detect: [ :each | each userName = self userName ]. + profileTemp getLocalMessages. + ^ profileTemp \ No newline at end of file diff --git a/Socialmetrica.package/Tweet.class/instance/created.st b/Socialmetrica.package/Tweet.class/instance/created.st index 9c3e0a0..32c0f67 100644 --- a/Socialmetrica.package/Tweet.class/instance/created.st +++ b/Socialmetrica.package/Tweet.class/instance/created.st @@ -1,5 +1,5 @@ accessing created created class = DateAndTime ifTrue: [ ^ created ]. - ^ (created endsWith: 'GMT') ifTrue: [ ^ DateAndTime fromString: ((created splitOn: $,) second withoutSuffix: 'GMT') ]. - "^ DateAndTime fromString: created" \ No newline at end of file + ^ (created endsWith: 'GMT') + ifTrue: [ ^ DateAndTime fromString: ((created splitOn: $,) second withoutSuffix: 'GMT') ] ifFalse: [ ^ DateAndTime fromString: created ]. \ No newline at end of file diff --git a/Socialmetrica.package/TwitterUser.class/instance/asCardElement.st b/Socialmetrica.package/TwitterUser.class/instance/asCardElement.st index 787b8c3..2fda2bc 100644 --- a/Socialmetrica.package/TwitterUser.class/instance/asCardElement.st +++ b/Socialmetrica.package/TwitterUser.class/instance/asCardElement.st @@ -41,7 +41,7 @@ asCardElement BrButton new aptitude: BrGlamorousButtonWithLabelAptitude new; label: 'Tweets'; - action: [ :e | e phlow spawnObject: self getMessages ]. + action: [ :e | e phlow spawnObject: self messages ]. BrButton new aptitude: BrGlamorousButtonWithLabelAptitude new; label: 'Web view';