PHP Script to Grab more than 20 latest tweets from twitter account?

Discussion in 'PHP & Perl' started by Tosty, Mar 5, 2012.

  1. Tosty

    Tosty Registered Member

    Joined:
    Jan 3, 2012
    Messages:
    99
    Likes Received:
    5
    So i'm having a tough time loading more than the latest 20 tweets from a twitter account in PHP. When you go to someone's twitter account, you need to click on "load more tweets" in order to see more.. Anybody know how I can scrape more than 20 tweets at a time from twitter?

    Thanks for any help.
     
  2. JohnnySalami

    JohnnySalami Registered Member

    Joined:
    Jan 4, 2012
    Messages:
    82
    Likes Received:
    9
    Are you using the rss xml feed?
     
  3. CPAChamp

    CPAChamp Newbie

    Joined:
    Sep 7, 2010
    Messages:
    20
    Likes Received:
    0
    Occupation:
    Web Application Developer. Working on PHP , JavaSc
    Location:
    India
    Home Page:
    i can do this.p-m me the details.
     
  4. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,949
    Likes Received:
    1,949
    Find the last tweet data id:
    Code:
    data-item-id="LASTTWEETDATAID"
    Load:
    Code:
    https://api.twitter.com/1/statuses/user_timeline.json?max_id=LASTTWEETDATAID&count=21&include_entities=1&include_available_features=1&contributor_details=true&pc=true&ptw_envelope=true&include_rts=true&user_id=TWEETACCOUNTID

    Post with headers:
    Code:
    GET /1/statuses/user_timeline.json?max_id=177185549499637760&count=21&include_entities=1&include_available_features=1&contributor_details=true&pc=true&ptw_envelope=true&include_rts=true&user_id=127245578 HTTP/1.1
    Host	api.twitter.com
    User-Agent	Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
    Accept	application/json, text/javascript, */*; q=0.01
    Accept-Language	en-gb,en;q=0.5
    Accept-Encoding	gzip, deflate
    Connection	keep-alive
    X-PHX	true
    X-Requested-With	XMLHttpRequest
    Referer	https://api.twitter.com/receiver.html
    Cookie	xxx