Nitter: Improving tweets preview, metadata and collections management.
This commit is contained in:
parent
e5e8fea29d
commit
032e6fd7da
@ -1,8 +1,13 @@
|
|||||||
accessing
|
accessing
|
||||||
getMessages
|
getMessages
|
||||||
| lastTweetsRaw lastTweets |
|
| lastTweetsRaw customQuery lastTweets |
|
||||||
lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'.
|
lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'.
|
||||||
lastTweets := TweetsCollection new.
|
lastTweets := TweetsCollection new.
|
||||||
|
customQuery := Dictionary new
|
||||||
|
at: 'parameters' put: self;
|
||||||
|
at: 'date' put: DateAndTime now;
|
||||||
|
yourself.
|
||||||
|
lastTweets query: customQuery.
|
||||||
lastTweetsRaw do: [ :rssTweet |
|
lastTweetsRaw do: [ :rssTweet |
|
||||||
lastTweets add: ((Tweet new fromNitterRssItem: rssTweet ))
|
lastTweets add: ((Tweet new fromNitterRssItem: rssTweet ))
|
||||||
].
|
].
|
||||||
|
@ -9,7 +9,7 @@ asCardElement
|
|||||||
|
|
||||||
anEditor := BrEditor new
|
anEditor := BrEditor new
|
||||||
aptitude: BrGlamorousRegularEditorAptitude new + aModeLook;
|
aptitude: BrGlamorousRegularEditorAptitude new + aModeLook;
|
||||||
text: self text;
|
text: self textPreview;
|
||||||
vFitContent.
|
vFitContent.
|
||||||
|
|
||||||
textInfoPane := BrVerticalPane new
|
textInfoPane := BrVerticalPane new
|
||||||
|
@ -5,5 +5,5 @@ fromNitterRssItem: xmlItem
|
|||||||
user := NitterUser new
|
user := NitterUser new
|
||||||
userName: author .
|
userName: author .
|
||||||
created := (xmlItem xpath: 'pubDate') stringValue.
|
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: ''
|
id := ((xmlItem xpath: 'guid') stringValue splitOn: '/') last copyReplaceAll: '#m' with: ''
|
@ -2,4 +2,4 @@ accessing
|
|||||||
printOn: aStream
|
printOn: aStream
|
||||||
super printOn: aStream.
|
super printOn: aStream.
|
||||||
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" : [ ],
|
"pools" : [ ],
|
||||||
"classvars" : [ ],
|
"classvars" : [ ],
|
||||||
"instvars" : [
|
"instvars" : [
|
||||||
"tweets"
|
"tweets",
|
||||||
|
"query"
|
||||||
],
|
],
|
||||||
"name" : "TweetsCollection",
|
"name" : "TweetsCollection",
|
||||||
"type" : "normal"
|
"type" : "normal"
|
||||||
|
Loading…
Reference in New Issue
Block a user