This one is a bit odd, so hopefully someone knows why this is.
But if you use the user(twitter_id) call, you get back a
Twitter::User Object.
Some users will have all the attributes present,
but some others will always be missing ...
@friends_count, @profile_text_color, @statuses_count,
@profile_sidebar_border_color, @profile_background, @favourites_count,
@profile_sidebar_fill_color, @description, @profile_image_url,
@profile_link_color
Certain API calls return more information than others. The user class
handles all the possible data but you are correct in that all data is
not returned with each call.
On Dec 10, 2008, at 2:47 AM, trustfundbaby <ikecof...@gmail.com> wrote:
> This one is a bit odd, so hopefully someone knows why this is.
> But if you use the user(twitter_id) call, you get back a
> Twitter::User Object.
> Some users will have all the attributes present,
> but some others will always be missing ...
> @friends_count, @profile_text_color, @statuses_count,
> @profile_sidebar_border_color, @profile_background, @favourites_count,
> @profile_sidebar_fill_color, @description, @profile_image_url,
> @profile_link_color
> Certain API calls return more information than others. The user class
> handles all the possible data but you are correct in that all data is
> not returned with each call.
> On Dec 10, 2008, at 2:47 AM, trustfundbaby <ikecof...@gmail.com> wrote:
> > This one is a bit odd, so hopefully someone knows why this is.
> > But if you use the user(twitter_id) call, you get back a
> > Twitter::User Object.
> > Some users will have all the attributes present,
> > but some others will always be missing ...
> > @friends_count, @profile_text_color, @statuses_count,
> > @profile_sidebar_border_color, @profile_background, @favourites_count,
> > @profile_sidebar_fill_color, @description, @profile_image_url,
> > @profile_link_color
> But here's the thing.
> Its the same call ....
> Why does it return different data for some users than others?
> On Dec 10, 2:23 pm, John Nunemaker <nunema...@gmail.com> wrote:
>> Certain API calls return more information than others. The user class
>> handles all the possible data but you are correct in that all data is
>> not returned with each call.
>> On Dec 10, 2008, at 2:47 AM, trustfundbaby <ikecof...@gmail.com>
>> wrote:
>>> This one is a bit odd, so hopefully someone knows why this is.
>>> But if you use the user(twitter_id) call, you get back a
>>> Twitter::User Object.
>>> Some users will have all the attributes present,
>>> but some others will always be missing ...
>>> @friends_count, @profile_text_color, @statuses_count,
>>> @profile_sidebar_border_color, @profile_background,
>>> @favourites_count,
>>> @profile_sidebar_fill_color, @description, @profile_image_url,
>>> @profile_link_color
So I started looking into base.rb of the twitter gem and noticed that
the user call
\ruby\lib\ruby\gems\1.8\gems\twitter-0.3.7\lib\twitter
# returns all the profile information and the last status for a
user
def user(id_or_screenname)
users(request("users/show/#{id_or_screenname}.xml", :auth =>
true)).first
end
references the private call users
# Converts an hpricot doc to an array of users
def users(doc)
(doc/:user).inject([]) { |users, user| users <<
User.new_from_xml(user); users }
end
So I followed it further and looked up user.rb
and thats where I saw where it says exactly what I wrote in my
original posting
line 21
# optional, not always present
then it lists those attributes I listed above.
My question is, why are those attributes not always present ...
And I'm a little confused because in looking at that initial url
http://twitter.com/users/show/user_name.xml
I have not come across an instance where those attributes were
present.
On Dec 10, 10:55 pm, John Nunemaker <nunema...@gmail.com> wrote:
> Maybe some users are private? I don't know. You probably would have to
> ask on the twitter api mailing list.
> On Dec 10, 2008, at 11:02 PM, trustfundbaby wrote:
> > But here's the thing.
> > Its the same call ....
> > Why does it return different data for some users than others?
> > On Dec 10, 2:23 pm, John Nunemaker <nunema...@gmail.com> wrote:
> >> Certain API calls return more information than others. The user class
> >> handles all the possible data but you are correct in that all data is
> >> not returned with each call.
> >> On Dec 10, 2008, at 2:47 AM, trustfundbaby <ikecof...@gmail.com>
> >> wrote:
> >>> This one is a bit odd, so hopefully someone knows why this is.
> >>> But if you use the user(twitter_id) call, you get back a
> >>> Twitter::User Object.
> >>> Some users will have all the attributes present,
> >>> but some others will always be missing ...
> >>> @friends_count, @profile_text_color, @statuses_count,
> >>> @profile_sidebar_border_color, @profile_background,
> >>> @favourites_count,
> >>> @profile_sidebar_fill_color, @description, @profile_image_url,
> >>> @profile_link_color
> So I started looking into base.rb of the twitter gem and noticed that
> the user call
> \ruby\lib\ruby\gems\1.8\gems\twitter-0.3.7\lib\twitter
> # returns all the profile information and the last status for a
> user
> def user(id_or_screenname)
> users(request("users/show/#{id_or_screenname}.xml", :auth =>
> true)).first
> end
> references the private call users
> # Converts an hpricot doc to an array of users
> def users(doc)
> (doc/:user).inject([]) { |users, user| users <<
> User.new_from_xml(user); users }
> end
> So I followed it further and looked up user.rb
> and thats where I saw where it says exactly what I wrote in my
> original posting
> line 21
> # optional, not always present
> then it lists those attributes I listed above.
> My question is, why are those attributes not always present ...
> And I'm a little confused because in looking at that initial urlhttp://twitter.com/users/show/user_name.xml
> I have not come across an instance where those attributes were
> present.
> On Dec 10, 10:55 pm, John Nunemaker <nunema...@gmail.com> wrote:
> > Maybe some users are private? I don't know. You probably would have to
> > ask on the twitter api mailing list.
> > On Dec 10, 2008, at 11:02 PM, trustfundbaby wrote:
> > > But here's the thing.
> > > Its the same call ....
> > > Why does it return different data for some users than others?
> > > On Dec 10, 2:23 pm, John Nunemaker <nunema...@gmail.com> wrote:
> > >> Certain API calls return more information than others. The user class
> > >> handles all the possible data but you are correct in that all data is
> > >> not returned with each call.
> > >> On Dec 10, 2008, at 2:47 AM, trustfundbaby <ikecof...@gmail.com>
> > >> wrote:
> > >>> This one is a bit odd, so hopefully someone knows why this is.
> > >>> But if you use the user(twitter_id) call, you get back a
> > >>> Twitter::User Object.
> > >>> Some users will have all the attributes present,
> > >>> but some others will always be missing ...
> > >>> @friends_count, @profile_text_color, @statuses_count,
> > >>> @profile_sidebar_border_color, @profile_background,
> > >>> @favourites_count,
> > >>> @profile_sidebar_fill_color, @description, @profile_image_url,
> > >>> @profile_link_color
Because users get parsed in lots of places. Each status has a user for
example. The user xml that is with a status does not match the users/ show/ xml or at least it didn't at one time. /users/show is not the
only place where the xml for a user is presented, thus I have to allow
for handling the different information you can get in different api
calls other than /users/show.
> So I started looking into base.rb of the twitter gem and noticed that
> the user call
> \ruby\lib\ruby\gems\1.8\gems\twitter-0.3.7\lib\twitter
> # returns all the profile information and the last status for a
> user
> def user(id_or_screenname)
> users(request("users/show/#{id_or_screenname}.xml", :auth =>
> true)).first
> end
> references the private call users
> # Converts an hpricot doc to an array of users
> def users(doc)
> (doc/:user).inject([]) { |users, user| users <<
> User.new_from_xml(user); users }
> end
> So I followed it further and looked up user.rb
> and thats where I saw where it says exactly what I wrote in my
> original posting
> line 21
> # optional, not always present
> then it lists those attributes I listed above.
> My question is, why are those attributes not always present ...
> And I'm a little confused because in looking at that initial url
> http://twitter.com/users/show/user_name.xml
> I have not come across an instance where those attributes were
> present.
> On Dec 10, 10:55 pm, John Nunemaker <nunema...@gmail.com> wrote:
>> Maybe some users are private? I don't know. You probably would have
>> to
>> ask on the twitter api mailing list.
>> On Dec 10, 2008, at 11:02 PM, trustfundbaby wrote:
>>> But here's the thing.
>>> Its the same call ....
>>> Why does it return different data for some users than others?
>>> On Dec 10, 2:23 pm, John Nunemaker <nunema...@gmail.com> wrote:
>>>> Certain API calls return more information than others. The user
>>>> class
>>>> handles all the possible data but you are correct in that all
>>>> data is
>>>> not returned with each call.
>>>> On Dec 10, 2008, at 2:47 AM, trustfundbaby <ikecof...@gmail.com>
>>>> wrote:
>>>>> This one is a bit odd, so hopefully someone knows why this is.
>>>>> But if you use the user(twitter_id) call, you get back a
>>>>> Twitter::User Object.
>>>>> Some users will have all the attributes present,
>>>>> but some others will always be missing ...
>>>>> @friends_count, @profile_text_color, @statuses_count,
>>>>> @profile_sidebar_border_color, @profile_background,
>>>>> @favourites_count,
>>>>> @profile_sidebar_fill_color, @description, @profile_image_url,
>>>>> @profile_link_color