From e7973abbac9491dbb2d1bd81e1efdfe7c8d3c1a8 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 2 Jan 2022 19:55:03 -0500 Subject: [PATCH] Populating the NitterUser contents and improving data extraction. --- Datanalitica.package/NitterUser.class/instance/id.st | 3 +++ .../NitterUser.class/instance/profileImageUrl.st | 3 ++- .../NitterUser.class/instance/retrieveContents.st | 11 +++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Datanalitica.package/NitterUser.class/instance/id.st create mode 100644 Datanalitica.package/NitterUser.class/instance/retrieveContents.st diff --git a/Datanalitica.package/NitterUser.class/instance/id.st b/Datanalitica.package/NitterUser.class/instance/id.st new file mode 100644 index 0000000..4cadea2 --- /dev/null +++ b/Datanalitica.package/NitterUser.class/instance/id.st @@ -0,0 +1,3 @@ +accessing +id + ^ id ifNil: [id := self profileImageUrl segments third] \ No newline at end of file diff --git a/Datanalitica.package/NitterUser.class/instance/profileImageUrl.st b/Datanalitica.package/NitterUser.class/instance/profileImageUrl.st index 4214b41..7b64f58 100644 --- a/Datanalitica.package/NitterUser.class/instance/profileImageUrl.st +++ b/Datanalitica.package/NitterUser.class/instance/profileImageUrl.st @@ -1,3 +1,4 @@ accessing profileImageUrl - ^ profileImageUrl ifNil: [ (self rssFeed xmlDocument xpath: '//image/url') stringValue copyReplaceAll: '%2F' with: '/' ] \ No newline at end of file + ^ profileImageUrl ifNil: [ + profileImageUrl := ((self rssFeed xmlDocument xpath: '//image/url') stringValue copyReplaceAll: '%2F' with: '/') asUrl ] \ No newline at end of file diff --git a/Datanalitica.package/NitterUser.class/instance/retrieveContents.st b/Datanalitica.package/NitterUser.class/instance/retrieveContents.st new file mode 100644 index 0000000..831b923 --- /dev/null +++ b/Datanalitica.package/NitterUser.class/instance/retrieveContents.st @@ -0,0 +1,11 @@ +accessing +retrieveContents + self userName ifNil: [^ self]. + ^ self + id; + name; + description; + createdAt; + url; + profileImageUrl; + yourself. \ No newline at end of file