How to retrieve a specified number of recent tweets for a particular user passing username and number of tweets as parameter using php script?

Hi All

I have code to retrieve tweets but producing error
this is my code

$result=file_get_contents('https://api.twitter.com/1.1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=php_net&count=10');
$tweets=json_decode($result);
print_r($tweets);
vishnu kalakotaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
The code is not producing an "error" -- it's simply getting you to an endpoint of the API that returns a JSON object telling you that your request cannot be serviced.  The response code and message tell you why.  Generally speaking, you probably want to start your learning at https://dev.twitter.com/overview/documentation.  

In the instant case, you're going to need authentication, and probably will find OAuth to be the most flexible approach.
https://dev.twitter.com/oauth/overview/authentication-by-api-family
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vishnu kalakotaAuthor Commented:
Thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.