Nitter: Improving tweets preview, metadata and collections management.
This commit is contained in:
parent
e5e8fea29d
commit
032e6fd7da
@ -1,8 +1,13 @@
|
||||
accessing
|
||||
getMessages
|
||||
| lastTweetsRaw lastTweets |
|
||||
| lastTweetsRaw customQuery lastTweets |
|
||||
lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'.
|
||||
lastTweets := TweetsCollection new.
|
||||
customQuery := Dictionary new
|
||||
at: 'parameters' put: self;
|
||||
at: 'date' put: DateAndTime now;
|
||||
yourself.
|
||||
lastTweets query: customQuery.
|
||||
lastTweetsRaw do: [ :rssTweet |
|
||||
lastTweets add: ((Tweet new fromNitterRssItem: rssTweet ))
|
||||
].
|
||||
|
@ -9,7 +9,7 @@ asCardElement
|
||||
|
||||
anEditor := BrEditor new
|
||||
aptitude: BrGlamorousRegularEditorAptitude new + aModeLook;
|
||||
text: self text;
|
||||
text: self textPreview;
|
||||
vFitContent.
|
||||
|
||||
textInfoPane := BrVerticalPane new
|
||||
|
@ -5,5 +5,5 @@ fromNitterRssItem: xmlItem
|
||||
user := NitterUser new
|
||||
userName: author .
|
||||
created := (xmlItem xpath: 'pubDate') stringValue.
|
||||
text := (XMLHTMLParser on: (xmlItem xpath: 'description') stringValue) parseDocument stringValue.
|
||||
text := (xmlItem xpath: 'description') stringValue.
|
||||
id := ((xmlItem xpath: 'guid') stringValue splitOn: '/') last copyReplaceAll: '#m' with: ''
|
@ -2,4 +2,4 @@ accessing
|
||||
printOn: aStream
|
||||
super printOn: aStream.
|
||||
aStream
|
||||
nextPutAll: '( ',self text ,' )'
|
||||
nextPutAll: '( ',self textPreview ,' )'
|
@ -0,0 +1,6 @@
|
||||
accessing
|
||||
textPreview
|
||||
"I'm a utility method to improve the way text is rendered accordin to if it comes from
|
||||
Nitter or Twitter."
|
||||
^ (XMLHTMLParser on: self text) parseDocument stringValue
|
||||
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
dataStore
|
||||
^ (FileLocator userData / 'Socialmetrica') ensureCreateDirectory
|
@ -0,0 +1,6 @@
|
||||
accessing
|
||||
query: aDictionary
|
||||
"The dictionary has two keys: the query parameter(s) itself
|
||||
and the date when the query was executed.
|
||||
Such information is used to store/serialize query results outside of the image."
|
||||
query := aDictionary
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
query
|
||||
^ query
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
queryParameters
|
||||
^ self query at: 'parameters'
|
@ -0,0 +1,7 @@
|
||||
accessing
|
||||
store
|
||||
| localFolder parameters |
|
||||
parameters := self queryParameters .
|
||||
parameters class = NitterUser ifFalse: [ ^ self ].
|
||||
^ localFolder := (self dataStore / parameters userName) ensureCreateDirectory.
|
||||
|
@ -6,7 +6,8 @@
|
||||
"pools" : [ ],
|
||||
"classvars" : [ ],
|
||||
"instvars" : [
|
||||
"tweets"
|
||||
"tweets",
|
||||
"query"
|
||||
],
|
||||
"name" : "TweetsCollection",
|
||||
"type" : "normal"
|
||||
|
Loading…
Reference in New Issue
Block a user