Improved tweet metadata to reconstruct timelines and queries.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-04 10:42:39 -05:00
parent fb2feec7c3
commit 1aea7b1b7c
5 changed files with 21 additions and 19 deletions

View File

@ -4,19 +4,20 @@ getMessages
lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'. lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'.
lastTweets := TweetsCollection new. lastTweets := TweetsCollection new.
customQuery := Dictionary new customQuery := Dictionary new
at: 'parameters' put: self; at: 'parameters' put: self userNameLink;
at: 'date' put: DateAndTime now; at: 'date' put: DateAndTime now;
yourself. yourself.
lastTweets query: customQuery. lastTweets query: customQuery.
lastTweetsRaw doWithIndex: [ :rssTweet :i | | tempTweet | lastTweetsRaw doWithIndex: [ :rssTweet :i | | current previous |
tempTweet := Tweet new fromNitterRssItem: rssTweet. current := Tweet new fromNitterRssItem: rssTweet.
tempTweet metadata i < lastTweetsRaw size ifTrue: [
at: 'queryDate' put: (customQuery at: 'date'); previous := Tweet new fromNitterRssItem: (lastTweetsRaw at: i + 1).
at: 'order' put: i; current timelines
yourself. at: self userName put: previous id;
tempTweet user userName = self userName yourself.
ifFalse: [ tempTweet retweetedBy add: self userName ]. ].
lastTweets add: tempTweet current queries add: customQuery.
lastTweets add: current.
]. ].
^ lastTweets ^ lastTweets

View File

@ -25,14 +25,6 @@ asCardElement
fitContent; fitContent;
cellSpacing: 5; cellSpacing: 5;
addChildren: { 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 BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new; aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Details'; label: 'Details';

View 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 ]

View File

@ -1,3 +1,3 @@
accessing accessing
retweetedBy retweetedBy
^ self metadata at: 'retweetedBy' ifAbsentPut: [ Set new ] ^ self timelines keys collect: [ :author | author != self user userName ]

View 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 ].