Improving End Points.
This commit is contained in:
parent
78cc29b7d6
commit
eb23f2e9a0
@ -0,0 +1,8 @@
|
||||
as yet unclassified
|
||||
userEndPointFor: username selecting: tweetsOrMentions since: dateString
|
||||
"I build a shared URL for querying last 100 mentions or tweets for a particular user.
|
||||
Second parameter should be only 'tweets' or 'mentions', dateString should be YYYY-MM-DD."
|
||||
| commonQueryParameters |
|
||||
commonQueryParameters := '?expansions=author_id&tweet.fields=conversation_id,created_at&user.fields=username&max_results=100',
|
||||
'&start_time=', dateString,'T00:00:00Z&'.
|
||||
^ self usersBaseEndPoint, (self userIDFrom: username), '/', tweetsOrMentions, commonQueryParameters
|
@ -2,6 +2,6 @@ accessing
|
||||
userTweetsFrom: username
|
||||
| rawResponse queryURL |
|
||||
"The following query gets the last 100 tweets, that is the maximun allowed for a particular user without pagination:"
|
||||
queryURL := self usersBaseEndPoint, (self userIDFrom: username), '/tweets', self defaultQueryParameters.
|
||||
queryURL := self usersBaseEndPoint, (self userIDFrom: username), '/tweets', self defaultQueryParameters at: 'tweets'.
|
||||
rawResponse := self rawResponseForURL:queryURL.
|
||||
^ (STONJSON fromString: rawResponse)
|
Loading…
Reference in New Issue
Block a user