Improving variables for tracking data origins as results for the same query can change over time (for example in case an account is deleted).

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-08-30 15:04:03 -05:00
parent fc5f13e8d2
commit b2acdeba55
14 changed files with 45 additions and 10 deletions

View File

@ -1,5 +1,3 @@
accessing
addKeyword: keyword to: subtopic
self subtopics
at: subtopic put: keyword;
yourself.
(self subtopics at: subtopic) add: keyword.

View File

@ -1,5 +1,4 @@
accessing
userMentionsFor: username
| rawResponse queryURL |
"The following query gets the last 100 mentions that is the maximun allowed for a particular user without pagination:"
^ self userQueryFor: username selecting: 'mentions'

View File

@ -4,4 +4,7 @@ userQueryFor: username selecting: tweetsOrMentions
"The following query gets the last 100 tweets or mentions that is the maximun allowed for a particular user without pagination:"
queryURL := self userEndPointFor: username selecting: tweetsOrMentions.
rawResponse := self rawResponseForURL:queryURL.
^ TwitterAPIResponse new fromDictionary: (STONJSON fromString: rawResponse)
^ TwitterAPIResponse new
fromDictionary: (STONJSON fromString: rawResponse);
queryURL: queryURL;
date: DateAndTime now.

View File

@ -1,5 +1,8 @@
accessing
usersGroupMentioning: userName
| response |
response := self userQueryFor: userName selecting: 'mentions'.
^ TwitterUsersGroup new
users: (self usersMentioning: userName);
title: 'Users mentioning @', userName
users: response messagesAuthors;
title: 'Users mentioning @', userName;
origin: response queryURL

View File

@ -0,0 +1,4 @@
accessing
date: aDateAndTime
"As answers to the same query can change over time, for example regarding deteled users, its important to know where a query was ran."
date := aDateAndTime

View File

@ -0,0 +1,3 @@
accessing
date
^ date

View File

@ -0,0 +1,3 @@
accessing
fromQueryURL: aQueryURLString

View File

@ -0,0 +1,3 @@
accessing
queryURL: aQueryURLString
queryURL := aQueryURLString

View File

@ -0,0 +1,3 @@
accessing
queryURL
^ queryURL

View File

@ -8,7 +8,9 @@
"instvars" : [
"data",
"includes",
"meta"
"meta",
"queryURL",
"date"
],
"name" : "TwitterAPIResponse",
"type" : "normal"

View File

@ -0,0 +1,5 @@
I model a group of Twitter users. Generally I am the result of running a query on the Twitter API or refining over another
Twitter users group.
I have methods that allow the running of such queries and making visualizations on particular properties of my users
or their tweets and in the future I will support topic modelling.

View File

@ -0,0 +1,4 @@
accessing
origin: anObject
origin := anObject

View File

@ -0,0 +1,4 @@
accessing
origin
^ origin

View File

@ -1,5 +1,5 @@
{
"commentStamp" : "",
"commentStamp" : "<historical>",
"super" : "Object",
"category" : "Datanalitica-Datanalitica",
"classinstvars" : [ ],
@ -8,7 +8,8 @@
"instvars" : [
"users",
"title",
"discourseTopics"
"discourseTopics",
"origin"
],
"name" : "TwitterUsersGroup",
"type" : "normal"