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;
|
||||
yourself.
|
||||
lastTweets query: customQuery.
|
||||
lastTweetsRaw do: [ :rssTweet |
|
||||
lastTweets add: ((Tweet new fromNitterRssItem: rssTweet ))
|
||||
lastTweetsRaw doWithIndex: [ :rssTweet :i | | tempTweet |
|
||||
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
|
||||
|
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",
|
||||
"authorId",
|
||||
"conversationId",
|
||||
"user"
|
||||
"user",
|
||||
"metadata",
|
||||
"metrics"
|
||||
],
|
||||
"name" : "Tweet",
|
||||
"type" : "normal"
|
||||
|
@ -2,7 +2,8 @@ accessing
|
||||
store
|
||||
| localFolder parameters |
|
||||
parameters := self queryParameters .
|
||||
parameters class = NitterUser ifFalse: [ ^ self ].
|
||||
localFolder := (self dataStore / parameters userName) ensureCreateDirectory.
|
||||
(parameters class = NitterUser or: [ parameters class = TwitterUser ])
|
||||
ifFalse: [ ^ self ].
|
||||
localFolder := (self dataStore / 'twitter.com' / parameters userName) ensureCreateDirectory.
|
||||
self tweets do: [:each | each exportInto: localFolder ].
|
||||
^ localFolder
|
Loading…
Reference in New Issue
Block a user