Improved tweet metadata to reconstruct timelines and queries.
This commit is contained in:
parent
fb2feec7c3
commit
1aea7b1b7c
@ -4,19 +4,20 @@ getMessages
|
||||
lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'.
|
||||
lastTweets := TweetsCollection new.
|
||||
customQuery := Dictionary new
|
||||
at: 'parameters' put: self;
|
||||
at: 'parameters' put: self userNameLink;
|
||||
at: 'date' put: DateAndTime now;
|
||||
yourself.
|
||||
lastTweets query: customQuery.
|
||||
lastTweetsRaw doWithIndex: [ :rssTweet :i | | tempTweet |
|
||||
tempTweet := Tweet new fromNitterRssItem: rssTweet.
|
||||
tempTweet metadata
|
||||
at: 'queryDate' put: (customQuery at: 'date');
|
||||
at: 'order' put: i;
|
||||
yourself.
|
||||
tempTweet user userName = self userName
|
||||
ifFalse: [ tempTweet retweetedBy add: self userName ].
|
||||
lastTweets add: tempTweet
|
||||
lastTweetsRaw doWithIndex: [ :rssTweet :i | | current previous |
|
||||
current := Tweet new fromNitterRssItem: rssTweet.
|
||||
i < lastTweetsRaw size ifTrue: [
|
||||
previous := Tweet new fromNitterRssItem: (lastTweetsRaw at: i + 1).
|
||||
current timelines
|
||||
at: self userName put: previous id;
|
||||
yourself.
|
||||
].
|
||||
current queries add: customQuery.
|
||||
lastTweets add: current.
|
||||
].
|
||||
^ lastTweets
|
||||
|
@ -25,14 +25,6 @@ asCardElement
|
||||
fitContent;
|
||||
cellSpacing: 5;
|
||||
addChildren: {
|
||||
BrButton new
|
||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||
label: 'Toggle subtopics';
|
||||
action: [ anEditor beEditable ].
|
||||
BrButton new
|
||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||
label: 'Add subtopic keyword';
|
||||
action: [ anEditor beReadOnlyWithSelection ].
|
||||
BrButton new
|
||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||
label: 'Details';
|
||||
|
4
Socialmetrica.package/Tweet.class/instance/queries.st
Normal file
4
Socialmetrica.package/Tweet.class/instance/queries.st
Normal file
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
queries
|
||||
"A list of the queries where the tweet has been present"
|
||||
^ self metadata at: 'queries' ifAbsentPut: [ OrderedCollection new ]
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
retweetedBy
|
||||
^ self metadata at: 'retweetedBy' ifAbsentPut: [ Set new ]
|
||||
^ self timelines keys collect: [ :author | author != self user userName ]
|
5
Socialmetrica.package/Tweet.class/instance/timelines.st
Normal file
5
Socialmetrica.package/Tweet.class/instance/timelines.st
Normal file
@ -0,0 +1,5 @@
|
||||
accessing
|
||||
timelines
|
||||
"A dictionary of several the timelines where this tweet appears.
|
||||
The key is the user's timeline and the value is the message id before this particular message appears in such user's timeline."
|
||||
^ self metadata at: 'timelines' ifAbsentPut: [ Dictionary new ].
|
Loading…
Reference in New Issue
Block a user