Renaming methods for clarity.
This commit is contained in:
parent
b9eedc6ec3
commit
f97b193c5e
@ -17,14 +17,14 @@ collectRawTweetsForPages: anInteger
|
||||
tempTweet metadata
|
||||
at: DateAndTime now asString put: key;
|
||||
yourself.
|
||||
response tweets add: tempTweet.
|
||||
response messages add: tempTweet.
|
||||
]
|
||||
].
|
||||
response tweets doWithIndex: [ :tweet :i |
|
||||
response messages doWithIndex: [ :tweet :i |
|
||||
| current previous |
|
||||
current := response tweets at: i.
|
||||
i < response tweets size ifTrue: [
|
||||
previous := response tweets at: i + 1.
|
||||
current := response messages at: i.
|
||||
i < response messages size ifTrue: [
|
||||
previous := response messages at: i + 1.
|
||||
current timelines
|
||||
at: self userName put: previous id;
|
||||
yourself ]].
|
||||
|
@ -1,15 +1,14 @@
|
||||
accessing
|
||||
getLocalMessages
|
||||
"TO DO! This method should return messages from the local database"
|
||||
| allTweets myTweets tempTweets tempUsername |
|
||||
| allTweets myTweets tweetsWithAntecesor |
|
||||
|
||||
tempUsername := self userName.
|
||||
TweetsCollection storeDB.
|
||||
allTweets := Tweet storedInstances asOrderedCollection.
|
||||
allTweets ifNil: [ ^ nil ].
|
||||
myTweets := TweetsCollection new.
|
||||
tempTweets := allTweets select: [ :each | each timelines isNotEmpty and: [each timelines keys first = tempUsername] ].
|
||||
myTweets tweets: tempTweets.
|
||||
self tweets: myTweets.
|
||||
^ {self tweets. self userName. tempTweets}
|
||||
tweetsWithAntecesor := allTweets select: [ :each | each timelines isNotEmpty and: [ each timelines keys first = self userName ]].
|
||||
myTweets messages: tweetsWithAntecesor.
|
||||
self messages: myTweets.
|
||||
^ self messages
|
||||
|
@ -1,4 +1,4 @@
|
||||
accessing
|
||||
getMessages
|
||||
self getLocalMessages ifNil: [ self getRemoteMessagesFromRss ].
|
||||
^ self tweets
|
||||
^ self messages
|
@ -19,4 +19,4 @@ getRemoteMessagesFromRss
|
||||
yourself ].
|
||||
current queries add: customQuery.
|
||||
lastTweets add: current ].
|
||||
self tweets: lastTweets
|
||||
self messages: lastTweets
|
@ -4,7 +4,7 @@ storeContents
|
||||
| objectString directory tempFile oldFile dehidratated |
|
||||
|
||||
dehidratated := self copy.
|
||||
dehidratated tweets: nil.
|
||||
dehidratated messages: nil.
|
||||
objectString := STON toStringPretty: dehidratated.
|
||||
directory := self folder ensureCreateDirectory.
|
||||
oldFile := directory / 'profile', 'ston'.
|
||||
|
@ -0,0 +1,6 @@
|
||||
accessing
|
||||
tweets
|
||||
self messages ifNil: [ ^ nil ].
|
||||
^ TweetsCollection new
|
||||
messages: (self messages messages select: [ :each | each authorId = self id ]);
|
||||
yourself
|
@ -2,8 +2,8 @@ accessing
|
||||
writeWordsFile
|
||||
|
||||
| rawTweets rawWords collectionsWords count |
|
||||
self tweets ifNil: [ ^ self ].
|
||||
rawTweets := self tweets tweets.
|
||||
self messages ifNil: [ ^ self ].
|
||||
rawTweets := self messages messages.
|
||||
|
||||
rawWords := OrderedCollection new.
|
||||
collectionsWords := ((rawTweets select:
|
||||
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
add: aTweet
|
||||
self tweets add: aTweet
|
||||
self messages add: aTweet
|
@ -11,7 +11,7 @@ gtTweetsFor: aView
|
||||
c vertical fitContent.
|
||||
c horizontal matchParent ];
|
||||
padding: (BlInsets all: 10).
|
||||
self tweets do: [ :each |
|
||||
self messages do: [ :each |
|
||||
imageContainer := BrAsyncWidget new
|
||||
aptitude: BrShadowAptitude new;
|
||||
background: Color white;
|
||||
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
messages: aTweetsCollection
|
||||
^ tweets := aTweetsCollection
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
messages
|
||||
^ tweets ifNil: [ tweets := OrderedCollection new]
|
@ -0,0 +1,7 @@
|
||||
accessing
|
||||
newest
|
||||
self messages ifNil: [ ^ nil ].
|
||||
self messages ifNilEmpty: [ ^ nil ].
|
||||
self pinned created > self messages second created
|
||||
ifTrue: [ ^ self pinned ]
|
||||
ifFalse: [ ^ self messages second ]
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
oldest
|
||||
^ self messages last
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
size
|
||||
^ self tweets size
|
||||
^ self messages size
|
@ -1,7 +1,7 @@
|
||||
accessing
|
||||
store
|
||||
ReStore isConnected ifFalse: [ self class storeDB]. "Starting the ReStore singleton."
|
||||
self tweets do: [:each | ReStore evaluateAsTransaction: [
|
||||
self messages do: [:each | ReStore evaluateAsTransaction: [
|
||||
each store.
|
||||
each user isInDB ifFalse: [ each user store ]
|
||||
]
|
||||
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
tweets: aTweetsCollection
|
||||
^ tweets := aTweetsCollection
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
tweets
|
||||
^ tweets ifNil: [ tweets := OrderedCollection new]
|
@ -8,7 +8,7 @@ messagesAuthors
|
||||
(groupedTweets at: (user id)) do: [:tweetDict | | currentTweet |
|
||||
currentTweet := Tweet new fromDictionary: tweetDict.
|
||||
currentTweet user: user.
|
||||
user tweets add: currentTweet.
|
||||
user messages add: currentTweet.
|
||||
].
|
||||
user.
|
||||
]
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
messages: aTweetsCollection
|
||||
messages := aTweetsCollection
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
messages
|
||||
^ messages ifNil: [ messages := OrderedCollection new ]
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
tweets: aTweetsCollection
|
||||
tweets := aTweetsCollection
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
tweets
|
||||
^ tweets ifNil: [ tweets := OrderedCollection new ]
|
@ -12,11 +12,11 @@
|
||||
"profileImageUrl",
|
||||
"description",
|
||||
"metrics",
|
||||
"tweets",
|
||||
"createdAt",
|
||||
"groups",
|
||||
"url",
|
||||
"profileBio"
|
||||
"profileBio",
|
||||
"messages"
|
||||
],
|
||||
"name" : "TwitterUser",
|
||||
"type" : "normal"
|
||||
|
@ -10,4 +10,4 @@ gtTwitterUsersGroupOn: aView
|
||||
width: 75;
|
||||
column: 'User Name' text: [ :aTwitterUser | '@', aTwitterUser userName ];
|
||||
column: 'Name' text: [ :aTwitterUser | aTwitterUser name ];
|
||||
column: 'Mentions' text: [ :aTwitterUser | aTwitterUser tweets size asString ]
|
||||
column: 'Mentions' text: [ :aTwitterUser | aTwitterUser messages size asString ]
|
Loading…
Reference in New Issue
Block a user