From 292cb444b4c1cfc100f0f15e134810dcebc73464 Mon Sep 17 00:00:00 2001 From: ruidajo Date: Fri, 1 Apr 2022 17:37:54 -0500 Subject: [PATCH] Fixing NitterUser asDictonary for export with template. --- .../NitterUser.class/instance/downloadProfileImage.st | 2 +- .../NitterUser.class/instance/exportProfileImageOn..st | 1 - .../NitterUser.class/instance/exportWithTemplate.On..st | 6 ++---- .../NitterUser.class/instance/externalWordCloud.st | 2 +- .../NitterUser.class/instance/profileBio.st | 2 +- .../NitterUser.class/instance/profileImageFile.st | 7 +++++++ .../TwitterUser.class/instance/profileImageFile.st | 3 --- Datanalitica.package/TwitterUser.class/properties.json | 1 - 8 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 Datanalitica.package/NitterUser.class/instance/profileImageFile.st delete mode 100644 Datanalitica.package/TwitterUser.class/instance/profileImageFile.st diff --git a/Datanalitica.package/NitterUser.class/instance/downloadProfileImage.st b/Datanalitica.package/NitterUser.class/instance/downloadProfileImage.st index 1c167f6..0cae0dc 100644 --- a/Datanalitica.package/NitterUser.class/instance/downloadProfileImage.st +++ b/Datanalitica.package/NitterUser.class/instance/downloadProfileImage.st @@ -1,4 +1,4 @@ accessing downloadProfileImage - self exportProfileImageOn: self folder / self userName, '.jpg' \ No newline at end of file + ^ self exportProfileImageOn: self folder / self userName, 'jpg' \ No newline at end of file diff --git a/Datanalitica.package/NitterUser.class/instance/exportProfileImageOn..st b/Datanalitica.package/NitterUser.class/instance/exportProfileImageOn..st index 4039d1a..fcd8fd9 100644 --- a/Datanalitica.package/NitterUser.class/instance/exportProfileImageOn..st +++ b/Datanalitica.package/NitterUser.class/instance/exportProfileImageOn..st @@ -7,6 +7,5 @@ exportProfileImageOn: fileReference file exists ifFalse: [ file ensureCreateFile ]. file binaryWriteStreamDo: [ :stream | stream nextPutAll: profileImageUrl retrieveContents ]. - profileImageFile := file. super class inform: 'Exported as: ', String cr, file fullName. ^ file \ No newline at end of file diff --git a/Datanalitica.package/NitterUser.class/instance/exportWithTemplate.On..st b/Datanalitica.package/NitterUser.class/instance/exportWithTemplate.On..st index 8171291..899cd21 100644 --- a/Datanalitica.package/NitterUser.class/instance/exportWithTemplate.On..st +++ b/Datanalitica.package/NitterUser.class/instance/exportWithTemplate.On..st @@ -1,9 +1,7 @@ accessing exportWithTemplate: mustacheFile On: folder - | mustacheDoc | - self exportProfileImageOn:folder / userName, '-profileImage.jpg'. - mustacheDoc := mustacheFile asMustacheTemplate value: self asDictionary. MarkupFile exportAsFileOn: (folder / self userName , 'tex') - containing: mustacheDoc \ No newline at end of file + containing:(mustacheFile asMustacheTemplate value: + self asDictionary) \ No newline at end of file diff --git a/Datanalitica.package/NitterUser.class/instance/externalWordCloud.st b/Datanalitica.package/NitterUser.class/instance/externalWordCloud.st index f527851..988b988 100644 --- a/Datanalitica.package/NitterUser.class/instance/externalWordCloud.st +++ b/Datanalitica.package/NitterUser.class/instance/externalWordCloud.st @@ -14,7 +14,7 @@ externalWordCloud '--background' . 'white' . '--mode' . 'RGBA' . '--stopwords' . 'stopwords-es.txt' . - '--mask' . 'nube-mascara.jpg'}; + '--mask' . '../commons/nube-mascara.jpg'}; workingDirectory: self folder fullName; redirectStdout; redirectStderr; diff --git a/Datanalitica.package/NitterUser.class/instance/profileBio.st b/Datanalitica.package/NitterUser.class/instance/profileBio.st index cb3348a..9b5d386 100644 --- a/Datanalitica.package/NitterUser.class/instance/profileBio.st +++ b/Datanalitica.package/NitterUser.class/instance/profileBio.st @@ -1,4 +1,4 @@ accessing profileBio - ^ profileBio := (self documentTree xpath: '/html/body/div/div/div[2]/div[1]/div[2]/div[1]') stringValue \ No newline at end of file + ^ profileBio ifNil: [ profileBio := (self documentTree xpath: '/html/body/div/div/div[2]/div[1]/div[2]/div[1]') stringValue] \ No newline at end of file diff --git a/Datanalitica.package/NitterUser.class/instance/profileImageFile.st b/Datanalitica.package/NitterUser.class/instance/profileImageFile.st new file mode 100644 index 0000000..01e8798 --- /dev/null +++ b/Datanalitica.package/NitterUser.class/instance/profileImageFile.st @@ -0,0 +1,7 @@ +accessing +profileImageFile + + | file | + file := (self folder / self userName, 'jpg'). + file exists ifTrue: [ ^ file ]. + ^ self downloadProfileImage \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/profileImageFile.st b/Datanalitica.package/TwitterUser.class/instance/profileImageFile.st deleted file mode 100644 index bdc9f62..0000000 --- a/Datanalitica.package/TwitterUser.class/instance/profileImageFile.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -profileImageFile - ^ profileImageFile \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/properties.json b/Datanalitica.package/TwitterUser.class/properties.json index 15e1273..2ed581f 100644 --- a/Datanalitica.package/TwitterUser.class/properties.json +++ b/Datanalitica.package/TwitterUser.class/properties.json @@ -16,7 +16,6 @@ "createdAt", "groups", "url", - "profileImageFile", "profileBio" ], "name" : "TwitterUser",