Fixing raw tweets collection and tweets filtering from html.

This commit is contained in:
ruidajo 2022-04-25 18:59:10 -05:00
parent b964460fa3
commit bd69b73529
7 changed files with 13 additions and 8 deletions

View File

@ -20,13 +20,14 @@ collectRawTweetsUpToPage: anInteger
response add: tempTweet.
]
].
"response messages doWithIndex: [ :tweet :i |
response messages: (response messages select: [ :tweet | tweet isNotNil ]).
response messages doWithIndex: [ :tweet :i |
| current previous |
current := response messages at: i.
i < response messages size ifTrue: [
i < response lastIndex ifTrue: [
previous := response messages at: i + 1.
current timelines
at: self userName put: previous id;
yourself ]]."
yourself ]].
^ response.

View File

@ -3,7 +3,7 @@ quotes
self messages ifEmpty: [ self getMessages ].
^ TweetsCollection new
messages: (self messages messages
messages: (self messages
select: [ :each |
(each metadata at: 'quote') isNotEmpty and: [ each user userName = self userName] ]);
yourself

View File

@ -3,5 +3,5 @@ replies
self messages ifEmpty: [ self getMessages ].
^ TweetsCollection new
messages: (self messages messages select: [ :each | (each metadata at: 'replie to') isNotEmpty ]);
messages: (self messages select: [ :each | (each metadata at: 'replie to') isNotEmpty ]);
yourself

View File

@ -3,5 +3,5 @@ retweets
self messages ifEmpty: [ self getMessages ].
^ TweetsCollection new
messages: (self messages messages select: [ :each | each authorId ~= self id]);
messages: (self messages select: [ :each | each authorId ~= self id]);
yourself

View File

@ -2,5 +2,5 @@ accessing
tweets
self messages ifEmpty: [ self getMessages ].
^ TweetsCollection new
messages: (self messages messages select: [ :each | each authorId = self id ]);
messages: (self messages select: [ :each | each authorId = self id ]);
yourself

View File

@ -0,0 +1,4 @@
accessing
lastIndex
^ lastIndex

View File

@ -1,3 +1,3 @@
accessing
messages
^ array "ifNil: [ array := OrderedCollection new ]"
^ array