Improving TwitterUser data collection and views.
This commit is contained in:
parent
11b95e0b19
commit
764078a241
@ -3,6 +3,6 @@ userEndPointFor: username selecting: tweetsOrMentions
|
||||
"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, if present, should be YYYY-MM-DD."
|
||||
| commonQueryParameters userFields |
|
||||
userFields := 'user.fields=username,name,description,profile_image_url'.
|
||||
userFields := 'user.fields=username,name,description,profile_image_url,created_at'.
|
||||
commonQueryParameters := '?expansions=author_id&tweet.fields=conversation_id,created_at&', userFields, '&max_results=100'.
|
||||
^ self usersBaseEndPoint, (self userIDFrom: username), '/', tweetsOrMentions, commonQueryParameters
|
@ -0,0 +1,15 @@
|
||||
accessing
|
||||
asCardElement
|
||||
^ BrHorizontalPane new
|
||||
hFitContent;
|
||||
vFitContent;
|
||||
padding: (BlInsets all: 20);
|
||||
margin: (BlInsets all: 10);
|
||||
addChild: (self profileImage asElement asScalableElement size: 64@64);
|
||||
addChild: (BrVerticalPane new
|
||||
fitContent;
|
||||
margin: (BlInsets left: 20);
|
||||
addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: '@', self userName);
|
||||
addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: self name);
|
||||
addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: 'joined: ', self createdAtShorted));
|
||||
when: BlClickEvent do: [:e | e target phlow spawnObject: self]
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
createdAt
|
||||
^ createdAt
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
createdAtShorted
|
||||
^ self createdAt copyFrom: 1 to: 7
|
@ -3,5 +3,6 @@ fromDictionary: userDict
|
||||
id := userDict at: 'id'.
|
||||
name := userDict at: 'name'.
|
||||
userName := userDict at: 'username'.
|
||||
createdAt := userDict at: 'created_at'.
|
||||
profileImageUrl := userDict at: 'profile_image_url'.
|
||||
description := userDict at: 'description'.
|
@ -12,7 +12,8 @@
|
||||
"profileImageUrl",
|
||||
"description",
|
||||
"metrics",
|
||||
"tweets"
|
||||
"tweets",
|
||||
"createdAt"
|
||||
],
|
||||
"name" : "TwitterUser",
|
||||
"type" : "normal"
|
||||
|
Loading…
Reference in New Issue
Block a user