diff --git a/Datanalitica.package/TwitterUser.class/instance/createdAtShorted.st b/Datanalitica.package/TwitterUser.class/instance/createdAtShorted.st index b617231..b836829 100644 --- a/Datanalitica.package/TwitterUser.class/instance/createdAtShorted.st +++ b/Datanalitica.package/TwitterUser.class/instance/createdAtShorted.st @@ -1,3 +1,3 @@ accessing createdAtShorted - ^ self createdAt copyFrom: 1 to: 7 \ No newline at end of file + ^ self createdAt asString copyFrom: 1 to: 7 \ No newline at end of file diff --git a/Datanalitica.package/TwitterUser.class/instance/fromNitterProfile..st b/Datanalitica.package/TwitterUser.class/instance/fromNitterProfile..st index ebcb157..614fff1 100644 --- a/Datanalitica.package/TwitterUser.class/instance/fromNitterProfile..st +++ b/Datanalitica.package/TwitterUser.class/instance/fromNitterProfile..st @@ -1,9 +1,14 @@ accessing fromNitterProfile: userNameString - | rssFeed title | - rssFeed := RSSTools createRSSFeedFor: 'https://nitter.net/', userNameString, '/rss'. + | nitterProfileLink rssFeed title nitterDocTree joinDateString | + nitterProfileLink := 'https://nitter.net/', userNameString. + rssFeed := RSSTools createRSSFeedFor: nitterProfileLink, '/rss'. 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: '/'. + 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. \ No newline at end of file