Twitter feed request url bad request in wordpress

159 Views Asked by At

I am trying to get the feeds from the twitter using below url

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=manjunath00789&count=4

Calling Code

$tweets = wp_remote_get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=manjunath00789&count=4/");
        var_dump($tweets);

It is giving error

{"errors":[{"message":"Bad Authentication data","code":215}]}

I had search on google but i could not found the solution.Can any body help to sort out the problem

2

There are 2 best solutions below

2
Brandon Hansen On

You will need to authenticate your app via oAuth. You can use this library

0
AudioBubble On

You need to be authenticated to fetch tweets. There is a library in JavaScript to fetch tweets without authentication.