2021-12-26 19:00:40 +00:00
|
|
|
accessing
|
|
|
|
fromNitterProfile: userNameString
|
2022-01-01 03:30:18 +00:00
|
|
|
| nitterProfileLink rssFeed title nitterDocTree joinDateString |
|
|
|
|
nitterProfileLink := 'https://nitter.net/', userNameString.
|
|
|
|
rssFeed := RSSTools createRSSFeedFor: nitterProfileLink, '/rss'.
|
2021-12-26 19:00:40 +00:00
|
|
|
title := rssFeed requiredItems title.
|
|
|
|
name := (title splitOn: '/') first trimmed.
|
|
|
|
"Tecnically we could just do 'userName' = 'userNameString'. But we want to capture also how it is expressed in the RSS."
|
|
|
|
userName := ((title splitOn: '/') second trimmed) allButFirst. "Taking out the '@' sign."
|
|
|
|
profileImageUrl := (rssFeed xmlDocument xpath: '//image/url') stringValue copyReplaceAll: '%2F' with: '/'.
|
2022-01-01 03:30:18 +00:00
|
|
|
nitterDocTree := (XMLDOMParser on: nitterProfileLink asUrl retrieveContents) parseDocument.
|
|
|
|
description := (nitterDocTree xpath: '//div[@class="profile-bio"]') stringValue.
|
|
|
|
joinDateString := ((nitterDocTree xpath: '//div[@class="profile-joindate"]/span/@title') stringValue).
|
|
|
|
createdAt := (ZTimestampFormat fromString:'4:05 PM - 03 Feb 2001') parse: joinDateString.
|