SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    791
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Twitter API timeline question...


    oh brother... get error when try to post a question here...
    https://dev.twitter.com/discussions/twitter-websites


    question re Twitter API user timeline:

    how do I get user avatar?? I cannot believe that when you request a user timeline it doesn't come with a url to the user's avatar....

    this is what I get if I request ONE tweet with this url
    $tweets = $Twitter->get('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=NewYorker&count=1'):

    http://mayacove.com/dev/tw/one_tweet.txt

    WHY is the user avatar not included here? it's included when you run a search.... why not when you request a user timeline?
    man, I don't get this, this should be a no-brainer.... so how do I get user avatar?

    urls posted here also don't work.. get exact same msg about upgrading to 1.1...
    (man, I guess these guys have never heard of a "falling back" transition period or anything like that....;-)


    thank you....

  2. #2
    SitePoint Mentor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,257
    Mentioned
    32 Post(s)
    Tagged
    5 Thread(s)
    Hey man, me again

    Quote Originally Posted by maya90 View Post
    how do I get user avatar?? I cannot believe that when you request a user timeline it doesn't come with a url to the user's avatar....

    this is what I get if I request ONE tweet with this url
    $tweets = $Twitter->get('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=NewYorker&count=1'):

    http://mayacove.com/dev/tw/one_tweet.txt
    The URL to the user's avatar is included in the response - about midway down the file you posted is this:
    Code:
    "profile_image_url": "http://a0.twimg.com/profile_images/553327850/Eustacewbutterfly_normal.png",


    Quote Originally Posted by maya90 View Post
    urls posted here also don't work.. get exact same msg about upgrading to 1.1...
    (man, I guess these guys have never heard of a "falling back" transition period or anything like that....;-)
    There was a transition period, but it ended on June this year, when v1 of the API was discontinued. If you check the accepted answer on that StackOverflow question you linked to, there's a note about the urls no longer working:
    Update: Support for this method has been removed from v1.1 of the API. Recommended practice going forward is GET /users/show and cache profile_image_url locally in your service/app.

  3. #3
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    791
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    hi fretburner, my mentor and savior! ;-)

    man, you must think I'm a jerk.. I was confused with this JSON, http://mayacove.com/dev/tw/one_tweet2.txt
    which I got the other day, I don't remember how, b/c I can't reproduce it now.. (no url for avatar here...)


    that worked..... thank you very much... :-)
    (there are two urls: http & https, which one should I use?)


    another question: I have been reading a lot of about Twitter's guidelines and requirements for displaying user timelines (they're very strict.. these guys really do protect their brand..) they say things like you have to indicate if it's a retweet and if it is, display the user's name and LINK to their TW profile page... (oh brother..)
    I'm confused as to how you can tell whether or not a tweet is a retweet...

    is this it? "retweeted": false,
    if it's a retweet, then this would be set to "true" and the name of the retweeter would be posted?
    (meaning I have to check when I'm looping for whether this is set to true? have yet to see one that is a retweet....)

    one more question (for now... oh brother, the more I do here, the more q's I have..)

    it's also a requirement to post the "action" buttons (reply, retweet, favorite...)
    I don't know how you create those buttons (there are no instructions like there are for "follow" buttons for example.. can't find anywhere.. (have successfully created a "follow" button...;-) (I can't just "firebug" these action buttons.. urls are "#".....;-)

    thank you again very much, FB!! :-)


  4. #4
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    791
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    now I have to do the "how long ago" tweet was posted feature.....

    does example here make sense to you?
    http://www.queness.com/post/8567/cre...ed-with-jquery

    thank you....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •