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 accessing
addKeyword: keyword to: subtopic addKeyword: keyword to: subtopic
self subtopics (self subtopics at: subtopic) add: keyword.
at: subtopic put: keyword;
yourself.

View File

@ -1,5 +1,4 @@
accessing accessing
userMentionsFor: username userMentionsFor: username
| rawResponse queryURL |
"The following query gets the last 100 mentions that is the maximun allowed for a particular user without pagination:" "The following query gets the last 100 mentions that is the maximun allowed for a particular user without pagination:"
^ self userQueryFor: username selecting: 'mentions' ^ 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:" "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. queryURL := self userEndPointFor: username selecting: tweetsOrMentions.
rawResponse := self rawResponseForURL:queryURL. 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 accessing
usersGroupMentioning: userName usersGroupMentioning: userName
| response |
response := self userQueryFor: userName selecting: 'mentions'.
^ TwitterUsersGroup new ^ TwitterUsersGroup new
users: (self usersMentioning: userName); users: response messagesAuthors;
title: 'Users mentioning @', userName 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" : [ "instvars" : [
"data", "data",
"includes", "includes",
"meta" "meta",
"queryURL",
"date"
], ],
"name" : "TwitterAPIResponse", "name" : "TwitterAPIResponse",
"type" : "normal" "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", "super" : "Object",
"category" : "Datanalitica-Datanalitica", "category" : "Datanalitica-Datanalitica",
"classinstvars" : [ ], "classinstvars" : [ ],
@ -8,7 +8,8 @@
"instvars" : [ "instvars" : [
"users", "users",
"title", "title",
"discourseTopics" "discourseTopics",
"origin"
], ],
"name" : "TwitterUsersGroup", "name" : "TwitterUsersGroup",
"type" : "normal" "type" : "normal"