Re: Static URL to profile picture

2008-10-10 Thread Shannon Whitley

We should also consider the user experience.  Some of my friends
change their avatar daily (if not hourly).  If each application caches
the avatar, the user might end up with a different avatar on each
application.  That would especially apply to applications that do not
need to update data regularly.  I like the 302 redirect approach.


On Oct 9, 8:26 am, jstrellner <[EMAIL PROTECTED]> wrote:
> I don't think they should do anything, but ask you guys to cache the
> profile pictures yourself.  By linking directly to the file, you are
> increasing their Amazon costs.  It doesn't take much to cache it
> yourself, and then every time someone does an update, you just check
> to see if the old URL that you have matches the new one, and if it
> doesn't, go get another copy of it to replace your cached file.
>
> I am not sure if they have encouraged, or discouraged hot-linking to
> their files, but it probably is the best solution to cache it, and one
> that Twitturly uses.
>
> -Joel
>
> On Oct 8, 4:25 pm, Nicolas Grasset <[EMAIL PROTECTED]> wrote:
>
>
>
> > Is there a way to get a static profile picture URL when using the API,
> > since picture updates will break old links?
>
> > My 
> > photo:http://s3.amazonaws.com/twitter_production/profile_images/38643882/av...
>
> > ... will have a different URL if I change it on Twitter, which means
> > we cannot trust our local cache of events, which means we would need
> > to call the APIs for all events all the time.
>
> > And in our case that is not really an option.
>
> > Thanks!!- Hide quoted text -
>
> - Show quoted text -


Re: Static URL to profile picture

2008-10-10 Thread Stut


On 10 Oct 2008, at 10:26, jstrellner wrote:

Alex: Any easy way to appease everyone who needs to access it, without
doing any infrastructure changes on your part, is to add a new API
call, http://twitter.com/statuses/user_avatar/username (for example).
Then when someone requests that URL, you just do a 302 redirect to the
avatar's current location.

Some of the nice things about doing a 302 temporary redirect are:
- For API Users, they never need to worry about where it is or what it
is named, they just need the twitter username (user id would be good
to support too)
- If you guys ever need to move all of those images out of amazon to
your own, or other solution, you can and it wouldn't effect anyone.
- ability to perform statistical analysis on who is requesting them,
and how often.
- doesn't require any changes to your current caching system, just a
minor change to the API


I like this idea except that doing that is no different to providing  
an unlimited API call to get the current avatar URL - it's still  
hitting their data retrieval systems just as hard.


-Stut

--
http://stut.net/


Re: Static URL to profile picture

2008-10-10 Thread jstrellner

Carl: They provide the URL to the image in all of that users updates,
so if you are getting tweets for a user, you are getting their profile
picture (avatar) URL.  It shouldn't require any additional calls.


Alex: Any easy way to appease everyone who needs to access it, without
doing any infrastructure changes on your part, is to add a new API
call, http://twitter.com/statuses/user_avatar/username (for example).
Then when someone requests that URL, you just do a 302 redirect to the
avatar's current location.

Some of the nice things about doing a 302 temporary redirect are:
- For API Users, they never need to worry about where it is or what it
is named, they just need the twitter username (user id would be good
to support too)
- If you guys ever need to move all of those images out of amazon to
your own, or other solution, you can and it wouldn't effect anyone.
- ability to perform statistical analysis on who is requesting them,
and how often.
- doesn't require any changes to your current caching system, just a
minor change to the API


Xeoncross: The image files can also have endings in '.gif', '.jpeg',
or '.png'.  They do not currently convert the images into a single
format, which is another reason the 302 redirect that I proposed above
would be ideal.


-Joel

On Oct 9, 8:38 am, Carl Crawley <[EMAIL PROTECTED]> wrote:
> jstrellner wrote:
> > I don't think they should do anything, but ask you guys to cache the
> > profile pictures yourself.  By linking directly to the file, you are
> > increasing their Amazon costs.  It doesn't take much to cache it
> > yourself, and then every time someone does an update, you just check
> > to see if the old URL that you have matches the new one, and if it
> > doesn't, go get another copy of it to replace your cached file.
>
> > I am not sure if they have encouraged, or discouraged hot-linking to
> > their files, but it probably is the best solution to cache it, and one
> > that Twitturly uses.
>
> > -Joel
>
> I can see what you're saying Joel, but surely to reduce the number of
> API calls to the API would be more of a saving to the load on Twitter
> rather than the 0.1$ saving by caching the images on my servers
>
> C.


Re: Static URL to profile picture

2008-10-09 Thread Carl Crawley

jstrellner wrote:
> I don't think they should do anything, but ask you guys to cache the
> profile pictures yourself.  By linking directly to the file, you are
> increasing their Amazon costs.  It doesn't take much to cache it
> yourself, and then every time someone does an update, you just check
> to see if the old URL that you have matches the new one, and if it
> doesn't, go get another copy of it to replace your cached file.
>
> I am not sure if they have encouraged, or discouraged hot-linking to
> their files, but it probably is the best solution to cache it, and one
> that Twitturly uses.
>
> -Joel
>
>   
I can see what you're saying Joel, but surely to reduce the number of 
API calls to the API would be more of a saving to the load on Twitter 
rather than the 0.1$ saving by caching the images on my servers

C.


Re: Static URL to profile picture

2008-10-09 Thread Xeoncross


Just set the profile image as "USER_ID.jpg" so that no mater what they
use for their image it will always be a unique file name to the user.


Re: Static URL to profile picture

2008-10-09 Thread Nicolas Grasset

We are developing  an iPhone application which among other things
aggregates content from different social networks to create a pulse
view.

Given the bad tools for memory management on the iPhone, cached photos
are quickly swapped out so this solution is our temporary one but
still requires a fix.

What happened to the API for photos documented on the unofficial
documentation? Ever existed or removed for performance issues?
http://static.twitter.com/system/user/profile_image/1050881/normal/rickm.png?1173740203

Thanks a lot!


On Oct 9, 10:17 am, "Alex Payne" <[EMAIL PROTECTED]> wrote:
> The changing URLs have been an asset for quick cache expiry for us,
> but I understand that more predicable URLs would be easier for
> developers.  We'll consider changing this behavior in the next major
> release of the API, but it's not going to change in the current
> version.
>
> I would suggest caching on the client side where possible, as Joel suggests.
>
>
>
> On Thu, Oct 9, 2008 at 8:26 AM, jstrellner <[EMAIL PROTECTED]> wrote:
>
> > I don't think they should do anything, but ask you guys to cache the
> > profile pictures yourself.  By linking directly to the file, you are
> > increasing their Amazon costs.  It doesn't take much to cache it
> > yourself, and then every time someone does an update, you just check
> > to see if the old URL that you have matches the new one, and if it
> > doesn't, go get another copy of it to replace your cached file.
>
> > I am not sure if they have encouraged, or discouraged hot-linking to
> > their files, but it probably is the best solution to cache it, and one
> > that Twitturly uses.
>
> > -Joel
>
> > On Oct 8, 4:25 pm, Nicolas Grasset <[EMAIL PROTECTED]> wrote:
> >> Is there a way to get a static profile picture URL when using the API,
> >> since picture updates will break old links?
>
> >> My 
> >> photo:http://s3.amazonaws.com/twitter_production/profile_images/38643882/av...
>
> >> ... will have a different URL if I change it on Twitter, which means
> >> we cannot trust our local cache of events, which means we would need
> >> to call the APIs for all events all the time.
>
> >> And in our case that is not really an option.
>
> >> Thanks!!
>
> --
> Alex Payne - API Lead, Twitter, Inc.http://twitter.com/al3x


Re: Static URL to profile picture

2008-10-09 Thread Alex Payne

The changing URLs have been an asset for quick cache expiry for us,
but I understand that more predicable URLs would be easier for
developers.  We'll consider changing this behavior in the next major
release of the API, but it's not going to change in the current
version.

I would suggest caching on the client side where possible, as Joel suggests.

On Thu, Oct 9, 2008 at 8:26 AM, jstrellner <[EMAIL PROTECTED]> wrote:
>
> I don't think they should do anything, but ask you guys to cache the
> profile pictures yourself.  By linking directly to the file, you are
> increasing their Amazon costs.  It doesn't take much to cache it
> yourself, and then every time someone does an update, you just check
> to see if the old URL that you have matches the new one, and if it
> doesn't, go get another copy of it to replace your cached file.
>
> I am not sure if they have encouraged, or discouraged hot-linking to
> their files, but it probably is the best solution to cache it, and one
> that Twitturly uses.
>
> -Joel
>
> On Oct 8, 4:25 pm, Nicolas Grasset <[EMAIL PROTECTED]> wrote:
>> Is there a way to get a static profile picture URL when using the API,
>> since picture updates will break old links?
>>
>> My 
>> photo:http://s3.amazonaws.com/twitter_production/profile_images/38643882/av...
>>
>> ... will have a different URL if I change it on Twitter, which means
>> we cannot trust our local cache of events, which means we would need
>> to call the APIs for all events all the time.
>>
>> And in our case that is not really an option.
>>
>> Thanks!!
>



-- 
Alex Payne - API Lead, Twitter, Inc.
http://twitter.com/al3x


Re: Static URL to profile picture

2008-10-09 Thread Abraham Williams

http://code.google.com/p/twitter-api/issues/detail?id=117

On Oct 9, 9:03 am, Shannon Whitley <[EMAIL PROTECTED]> wrote:
> I agree too.  This request could really cut down on API calls.
>
> On Oct 8, 4:25 pm, Nicolas Grasset <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to get a static profile picture URL when using the API,
> > since picture updates will break old links?
>
> > My 
> > photo:http://s3.amazonaws.com/twitter_production/profile_images/38643882/av...
>
> > ... will have a different URL if I change it on Twitter, which means
> > we cannot trust our local cache of events, which means we would need
> > to call the APIs for all events all the time.
>
> > And in our case that is not really an option.
>
> > Thanks!!
>
>


Re: Static URL to profile picture

2008-10-09 Thread jstrellner

I don't think they should do anything, but ask you guys to cache the
profile pictures yourself.  By linking directly to the file, you are
increasing their Amazon costs.  It doesn't take much to cache it
yourself, and then every time someone does an update, you just check
to see if the old URL that you have matches the new one, and if it
doesn't, go get another copy of it to replace your cached file.

I am not sure if they have encouraged, or discouraged hot-linking to
their files, but it probably is the best solution to cache it, and one
that Twitturly uses.

-Joel

On Oct 8, 4:25 pm, Nicolas Grasset <[EMAIL PROTECTED]> wrote:
> Is there a way to get a static profile picture URL when using the API,
> since picture updates will break old links?
>
> My 
> photo:http://s3.amazonaws.com/twitter_production/profile_images/38643882/av...
>
> ... will have a different URL if I change it on Twitter, which means
> we cannot trust our local cache of events, which means we would need
> to call the APIs for all events all the time.
>
> And in our case that is not really an option.
>
> Thanks!!


Re: Static URL to profile picture

2008-10-09 Thread Shannon Whitley

I agree too.  This request could really cut down on API calls.


On Oct 8, 4:25 pm, Nicolas Grasset <[EMAIL PROTECTED]> wrote:
> Is there a way to get a static profile picture URL when using the API,
> since picture updates will break old links?
>
> My 
> photo:http://s3.amazonaws.com/twitter_production/profile_images/38643882/av...
>
> ... will have a different URL if I change it on Twitter, which means
> we cannot trust our local cache of events, which means we would need
> to call the APIs for all events all the time.
>
> And in our case that is not really an option.
>
> Thanks!!


Re: Static URL to profile picture

2008-10-09 Thread Carl Crawley

Kee Hinckley wrote:
>
> On Oct 8, 2008, at 7:25 PM, Nicolas Grasset wrote:
>> Is there a way to get a static profile picture URL when using the API,
>> since picture updates will break old links?
>
> That would really be nice. Given the security checks you have to do 
> when you use the user-provided filename, it seems like standardizing 
> on a filename and file ending would only make things easier for everyone.
Absolutely agree with this as well - I have to have a batch job to run 
through all my followers in my web-app to check changes of profile 
images - this would reduce my API calls significantly.

Rgds,

C.


Re: Static URL to profile picture

2008-10-08 Thread Kee Hinckley


On Oct 8, 2008, at 7:25 PM, Nicolas Grasset wrote:

Is there a way to get a static profile picture URL when using the API,
since picture updates will break old links?


That would really be nice. Given the security checks you have to do  
when you use the user-provided filename, it seems like standardizing  
on a filename and file ending would only make things easier for  
everyone.


Static URL to profile picture

2008-10-08 Thread Nicolas Grasset

Is there a way to get a static profile picture URL when using the API,
since picture updates will break old links?

My photo:
http://s3.amazonaws.com/twitter_production/profile_images/38643882/avatar_bigger.JPG

... will have a different URL if I change it on Twitter, which means
we cannot trust our local cache of events, which means we would need
to call the APIs for all events all the time.

And in our case that is not really an option.

Thanks!!