Adding tweet metadata and improving storage.
This commit is contained in:
parent
3d2a3d8696
commit
92b8d90d1b
@ -8,8 +8,15 @@ getMessages
|
|||||||
at: 'date' put: DateAndTime now;
|
at: 'date' put: DateAndTime now;
|
||||||
yourself.
|
yourself.
|
||||||
lastTweets query: customQuery.
|
lastTweets query: customQuery.
|
||||||
lastTweetsRaw do: [ :rssTweet |
|
lastTweetsRaw doWithIndex: [ :rssTweet :i | | tempTweet |
|
||||||
lastTweets add: ((Tweet new fromNitterRssItem: rssTweet ))
|
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
|
||||||
].
|
].
|
||||||
^ lastTweets
|
^ lastTweets
|
||||||
|
|
3
Socialmetrica.package/Tweet.class/instance/metadata..st
Normal file
3
Socialmetrica.package/Tweet.class/instance/metadata..st
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
metadata: aDictionary
|
||||||
|
metadata := aDictionary
|
3
Socialmetrica.package/Tweet.class/instance/metadata.st
Normal file
3
Socialmetrica.package/Tweet.class/instance/metadata.st
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
metadata
|
||||||
|
^ metadata ifNil: [ metadata := Dictionary new]
|
@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
retweetedBy
|
||||||
|
^ self metadata at: 'retweetedBy' ifAbsentPut: [ Set new ]
|
@ -11,7 +11,9 @@
|
|||||||
"id",
|
"id",
|
||||||
"authorId",
|
"authorId",
|
||||||
"conversationId",
|
"conversationId",
|
||||||
"user"
|
"user",
|
||||||
|
"metadata",
|
||||||
|
"metrics"
|
||||||
],
|
],
|
||||||
"name" : "Tweet",
|
"name" : "Tweet",
|
||||||
"type" : "normal"
|
"type" : "normal"
|
||||||
|
@ -2,7 +2,8 @@ accessing
|
|||||||
store
|
store
|
||||||
| localFolder parameters |
|
| localFolder parameters |
|
||||||
parameters := self queryParameters .
|
parameters := self queryParameters .
|
||||||
parameters class = NitterUser ifFalse: [ ^ self ].
|
(parameters class = NitterUser or: [ parameters class = TwitterUser ])
|
||||||
localFolder := (self dataStore / parameters userName) ensureCreateDirectory.
|
ifFalse: [ ^ self ].
|
||||||
|
localFolder := (self dataStore / 'twitter.com' / parameters userName) ensureCreateDirectory.
|
||||||
self tweets do: [:each | each exportInto: localFolder ].
|
self tweets do: [:each | each exportInto: localFolder ].
|
||||||
^ localFolder
|
^ localFolder
|
Loading…
Reference in New Issue
Block a user