Socialmetrica/Socialmetrica.package/NitterUser.class/instance/createdAt.st

9 lines
488 B
Smalltalk
Raw Normal View History

accessing
createdAt
^ createdAt ifNil: [| joinDateString |
joinDateString := ((self documentTree xpath: '//div[@class="profile-joindate"]/span/@title') stringValue).
joinDateString := joinDateString copyReplaceAll: '3 May' with: '03 May'.
joinDateString := joinDateString copyReplaceAll: '5 May' with: '05 May'.
joinDateString := joinDateString copyReplaceAll: '2 Feb' with: '02 Feb'.
createdAt := (ZTimestampFormat fromString:'4:05 PM - 03 Feb 2001') parse: joinDateString.
]