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

Tosty

Registered Member
Joined
Jan 3, 2012
Messages
99
Reaction score
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.
 
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
 
Back
Top