This commit is contained in:
ruidajo 2022-03-31 22:52:01 -05:00
commit d66cc2a62c
4 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,10 @@
accessing
getMessages
| lastTweetsRaw lastTweets |
lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'.
lastTweets := TweetsCollection new.
lastTweetsRaw do: [ :rssTweet |
lastTweets add: ((Tweet new fromNitterRssItem: rssTweet ))
].
^ lastTweets

View File

@ -0,0 +1,9 @@
accessing
fromNitterRssItem: xmlItem
| author |
author := (xmlItem xpath: 'dc:creator') stringValue allButFirst.
user := NitterUser new
userName: author .
created := (xmlItem xpath: 'pubDate') stringValue.
text := (XMLHTMLParser on: (xmlItem xpath: 'description') stringValue) parseDocument stringValue.
id := ((xmlItem xpath: 'guid') stringValue splitOn: '/') last copyReplaceAll: '#m' with: ''

View File

@ -41,7 +41,7 @@ asCardElement
BrButton new BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new; aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Tweets'; label: 'Tweets';
action: [ :e | e phlow spawnObject: self tweets ]. action: [ :e | e phlow spawnObject: self getMessages ].
BrButton new BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new; aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Web view'; label: 'Web view';

View File

@ -1,3 +1,3 @@
accessing accessing
tweets tweets
^ tweets ifNil: [ self tweets: self getMessages ] ^ tweets ifNil: [ tweets := OrderedCollection new ]