diff --git a/Datanalitica.package/Tweet.class/README.md b/Datanalitica.package/Tweet.class/README.md new file mode 100644 index 0000000..e69de29 diff --git a/Datanalitica.package/Tweet.class/instance/created.st b/Datanalitica.package/Tweet.class/instance/created.st new file mode 100644 index 0000000..dd73b5c --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/created.st @@ -0,0 +1,3 @@ +accessing +created + ^ created \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/fromDictionary..st b/Datanalitica.package/Tweet.class/instance/fromDictionary..st new file mode 100644 index 0000000..c9d81d2 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/fromDictionary..st @@ -0,0 +1,7 @@ +accessing +fromDictionary: aDictionary + created := (aDictionary at: 'created_at') asDateAndTime. + text := aDictionary at: 'text'. + id := aDictionary at: 'id'. + authorId := aDictionary at: 'author_id'. + ^ self \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/mentions..st b/Datanalitica.package/Tweet.class/instance/mentions..st new file mode 100644 index 0000000..6a16528 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/mentions..st @@ -0,0 +1,3 @@ +queries +mentions: aWord + ^ self text includesSubstring: aWord \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/printOn..st b/Datanalitica.package/Tweet.class/instance/printOn..st new file mode 100644 index 0000000..eacd230 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/printOn..st @@ -0,0 +1,5 @@ +accessing +printOn: aStream + super printOn: aStream. + aStream + nextPutAll: '( ',self text ,' )' \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/text.st b/Datanalitica.package/Tweet.class/instance/text.st new file mode 100644 index 0000000..3251dea --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/text.st @@ -0,0 +1,3 @@ +accessing +text + ^ text \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/words.st b/Datanalitica.package/Tweet.class/instance/words.st new file mode 100644 index 0000000..f8af065 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/words.st @@ -0,0 +1,3 @@ +utilities +words + ^ self text splitOn: Character space \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/wordsInLowercase.st b/Datanalitica.package/Tweet.class/instance/wordsInLowercase.st new file mode 100644 index 0000000..6379427 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/wordsInLowercase.st @@ -0,0 +1,3 @@ +accessing +wordsInLowercase + ^ self words collect: [:word | word asLowercase ] \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/properties.json b/Datanalitica.package/Tweet.class/properties.json new file mode 100644 index 0000000..236f531 --- /dev/null +++ b/Datanalitica.package/Tweet.class/properties.json @@ -0,0 +1,16 @@ +{ + "commentStamp" : "", + "super" : "Object", + "category" : "Datanalitica", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ + "created", + "text", + "id", + "authorId" + ], + "name" : "Tweet", + "type" : "normal" +} \ No newline at end of file diff --git a/Datanalitica.package/TwitterAPI.class/instance/userTweetsFor..st b/Datanalitica.package/TwitterAPI.class/instance/userTweetsFor..st deleted file mode 100644 index c40869f..0000000 --- a/Datanalitica.package/TwitterAPI.class/instance/userTweetsFor..st +++ /dev/null @@ -1,8 +0,0 @@ -accessing -userTweetsFor: username - | rawResponse queryURL parameters | - "The following query gets the last 100 tweets, that is the maximun allowed for a particular user without pagination:" - parameters := '?tweet.fields=created_at&expansions=author_id&user.fields=created_at&max_results=100'. - queryURL := self usersBaseEndPoint, (self userIDFrom: username), '/tweets', parameters. - rawResponse := self rawResponseForURL:queryURL. - ^ (STONJSON fromString: rawResponse) \ No newline at end of file diff --git a/Datanalitica.package/TwitterAPI.class/instance/userTweetsFrom.since.until..st b/Datanalitica.package/TwitterAPI.class/instance/userTweetsFrom.since.until..st index 1e360bf..3699894 100644 --- a/Datanalitica.package/TwitterAPI.class/instance/userTweetsFrom.since.until..st +++ b/Datanalitica.package/TwitterAPI.class/instance/userTweetsFrom.since.until..st @@ -13,6 +13,8 @@ userTweetsFrom: username since: startDateString until: endDateString '&', untilDate, '&', nextToken. response := STONJSON fromString: (self rawResponseForURL: queryUrl). - messages addAll: (response at: 'data'). + (response at: 'data') do: [:tweetData | + messages add: (Tweet new fromDictionary: tweetData) + ]. nextToken := 'pagination_token=',((response at: 'meta') at: 'next_token' ifAbsent: [ 'stop' ])]. ^ messages. \ No newline at end of file