Starting profile image preview support.
This commit is contained in:
parent
a7d7b66403
commit
63f409fad8
@ -0,0 +1,12 @@
|
||||
accessing
|
||||
gtUsersMentioning: userName On: aView
|
||||
<gtView>
|
||||
^ aView columnedList
|
||||
title: 'Users mentioning @',userName translated;
|
||||
priority: 5;
|
||||
items: [ self usersMentioning: userName ];
|
||||
column: 'Imagen'
|
||||
icon: [ :aTwitterUser | aTwitterUser profileImage asElement asScalableElement size: 32 @ 32 ]
|
||||
width: 75;
|
||||
column: 'User Name' text: [ :aTwitterUser | aTwitterUser userName ];
|
||||
column: 'Name' text: [ :aTwitterUser | aTwitterUser name ]
|
@ -1,7 +1,7 @@
|
||||
accessing
|
||||
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 should be YYYY-MM-DD."
|
||||
Second parameter should be only 'tweets' or 'mentions', dateString, if present, should be YYYY-MM-DD."
|
||||
| commonQueryParameters |
|
||||
commonQueryParameters := '?expansions=author_id&tweet.fields=conversation_id,created_at&user.fields=username&max_results=100'.
|
||||
commonQueryParameters := '?expansions=author_id&tweet.fields=conversation_id,created_at&user.fields=username,profile_image_url&max_results=100'.
|
||||
^ self usersBaseEndPoint, (self userIDFrom: username), '/', tweetsOrMentions, commonQueryParameters
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
usersMentioning: userName
|
||||
^ (self userMentionsFor: userName) messagesAuthors
|
@ -3,3 +3,4 @@ fromDictionary: userDict
|
||||
id := userDict at: 'id'.
|
||||
name := userDict at: 'name'.
|
||||
userName := userDict at: 'username'.
|
||||
profileImageUrl := userDict at: 'profile_image_url'.
|
@ -0,0 +1,9 @@
|
||||
accessing
|
||||
profileImage
|
||||
| response |
|
||||
response := ZnClient new url: (self profileImageUrl); get; response.
|
||||
response contentType = ZnMimeType imageJpeg
|
||||
ifTrue: [ ^ (JPEGReadWriter gtFromBuffer: response contents) asElement ].
|
||||
response contentType = ZnMimeType imagePng
|
||||
ifTrue: [ ^ (PNGReadWriter gtFromBuffer: response contents) asElement ].
|
||||
^ BlElement new background: Color gray
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
profileImageUrl
|
||||
^ profileImageUrl
|
@ -8,7 +8,8 @@
|
||||
"instvars" : [
|
||||
"id",
|
||||
"name",
|
||||
"userName"
|
||||
"userName",
|
||||
"profileImageUrl"
|
||||
],
|
||||
"name" : "TwitterUser",
|
||||
"type" : "normal"
|
||||
|
Loading…
Reference in New Issue
Block a user