Implementing tweets navigation in the NitterUser.
This commit is contained in:
parent
204a462a2a
commit
dd655260b4
@ -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
|
||||
|
@ -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: ''
|
@ -41,7 +41,7 @@ asCardElement
|
||||
BrButton new
|
||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||
label: 'Tweets';
|
||||
action: [ :e | e phlow spawnObject: self tweets ].
|
||||
action: [ :e | e phlow spawnObject: self getMessages ].
|
||||
BrButton new
|
||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||
label: 'Web view';
|
||||
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
tweets
|
||||
^ tweets ifNil: [ self tweets: self getMessages ]
|
||||
^ tweets ifNil: [ tweets := OrderedCollection new ]
|
Loading…
Reference in New Issue
Block a user