Modyfing nitter user sanitization for tex exporter.
This commit is contained in:
parent
104fe9e348
commit
aa5cf9cbba
@ -2,5 +2,6 @@ accessing
|
||||
createdAt
|
||||
^ createdAt ifNil: [| joinDateString |
|
||||
joinDateString := ((self documentTree xpath: '//div[@class="profile-joindate"]/span/@title') stringValue).
|
||||
joinDateString := joinDateString copyReplaceAll: '3 May' with: '03 May'.
|
||||
createdAt := (ZTimestampFormat fromString:'4:05 PM - 03 Feb 2001') parse: joinDateString.
|
||||
]
|
@ -1,13 +1,22 @@
|
||||
accessing
|
||||
exportWithTemplate: mustacheFile into: folder
|
||||
|
||||
| tempDictionary modified |
|
||||
| tempDictionary bioModified userModified nameModified |
|
||||
tempDictionary := self asDictionary copy.
|
||||
modified := self asDictionary at: 'profile-bio'.
|
||||
modified := modified copyReplaceAll: '@' with: '\@'.
|
||||
modified := modified copyReplaceAll: '_' with: '\_'.
|
||||
modified := modified copyReplaceAll: '#' with: '\#'.
|
||||
tempDictionary at: 'profile-bio' put: modified.
|
||||
bioModified := self asDictionary at: 'profile-bio'.
|
||||
bioModified := bioModified copyReplaceAll: '@' with: '\@'.
|
||||
bioModified := bioModified copyReplaceAll: '_' with: '\_'.
|
||||
bioModified := bioModified copyReplaceAll: '#' with: '\#'.
|
||||
bioModified := bioModified copyReplaceAll: '👑😎' with: ''.
|
||||
bioModified := bioModified copyReplaceAll: '🇨🇴' with: ''.
|
||||
bioModified := bioModified copyReplaceAll: '|' with: ''.
|
||||
userModified := self asDictionary at: 'profile-card-username'.
|
||||
userModified := userModified copyReplaceAll: '_' with: '\_'.
|
||||
nameModified := self asDictionary at: 'profile-card-fullname'.
|
||||
nameModified := nameModified copyReplaceAll: '🇨🇴' with: ''.
|
||||
tempDictionary at: 'profile-bio' put: bioModified;
|
||||
at: 'profile-card-username' put: userModified;
|
||||
at: 'profile-card-fullname' put: nameModified.
|
||||
^ MarkupFile
|
||||
exportAsFileOn: (folder / self userName , 'tex')
|
||||
containing:(mustacheFile asMustacheTemplate value: tempDictionary)
|
@ -3,5 +3,7 @@ url
|
||||
^ url ifNil: [ | temp |
|
||||
temp := ((self documentTree xpath: '//div[@class="profile-website"]') // 'a' @@ 'href') first.
|
||||
temp ifNil: [ ^ url := nil ].
|
||||
temp := temp replaceAll: $Ú with: $u.
|
||||
temp := temp replaceAll: $í with: $i.
|
||||
url := temp asUrl.
|
||||
]
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
messages
|
||||
^ messages ifNil: [ messages := OrderedCollection new ]
|
||||
^ messages ifNil: [ messages := TweetsCollection new ]
|
Loading…
Reference in New Issue
Block a user