Creating author ids to get all the ids from database and refactoring tweets filtering.

This commit is contained in:
ruidajo 2022-06-15 18:43:59 -05:00
parent 0b172e6f29
commit 61eb15f8e3
2 changed files with 10 additions and 32 deletions

View File

@ -0,0 +1,4 @@
accessing
authorIds
^ TwitterUser storedInstances select: [ :each | each userName = self userName ] thenCollect: [ :each | each id ]

View File

@ -3,36 +3,10 @@ tweets
| subcollection | | subcollection |
self messages ifEmpty: [ self getMessages ]. self messages ifEmpty: [ self getMessages ].
"TO DO: It seems that Twitter changes the user id, which we thought was unchangeable. This deals with the detected changes so far." "TO DO: It seems that Twitter changes the user id, which we thought was unchangeable. This deals with the detected changes so far."
self userName = 'FranciaMarquezM'
ifTrue: [
subcollection := self messages subcollection := self messages
select: [ :each | (each authorId = '1510420950801698826') or: [ each authorId = self id ] ] select: [ :each | self authorIds includes: each authorId ].
].
self userName = 'sandralajas'
ifTrue: [
subcollection := self messages
select: [ :each | (each authorId = '1502504562984374276') or: [ each authorId = self id ] ]
].
self userName = 'IBetancourtCol'
ifTrue: [
subcollection := self messages
select: [ :each | (each authorId = '1517487571135344643') or: [ each authorId = self id ] ]
].
self userName = 'sergio_fajardo'
ifTrue: [
subcollection := self messages
select: [ :each | (each authorId = '1509644668300058633') or: [ each authorId = self id ] ]
].
self userName = 'ingrodolfohdez'
ifTrue: [
subcollection := self messages
select: [ :each | (each authorId = '1511813393220616192') or: [ each authorId = self id ] ]
].
self userName = 'CastilloMarelen'
ifTrue: [
subcollection := self messages
select: [ :each | (each authorId = '1506282884746952707') or: [ each authorId = self id ] ]
].
(#('FranciaMarquezM' 'sandralajas' 'IBetancourtCol' 'sergio_fajardo' 'ingrodolfohdez' 'CastilloMarelen') includes: self userName) (#('FranciaMarquezM' 'sandralajas' 'IBetancourtCol' 'sergio_fajardo' 'ingrodolfohdez' 'CastilloMarelen') includes: self userName)
ifFalse: [ subcollection := self messages select: [ :each | each authorId = self id ]]. ifFalse: [ subcollection := self messages select: [ :each | each authorId = self id ]].
^ TweetsCollection new ^ TweetsCollection new