We are attempting to pull a user's twitter feed using javascript as JSON, and currently are just trying to save the url containing the JSON data to local storage. However, the url gives us the following error each time we attempt to access it:
{"errors":[{"code":215,"message":"Bad Authentication data."}]}
As far as we can tell from the documentation, the current way we are using the access token should work.
The code we are using is shown below:
<html>
<body>
<script>
var username = "FightMe123456"
var twitteraccesstoken = "3297223770-jC5411hhsODUXU6qbqTCbwFujaGliqVTtX9iwFK";
var twitterlink = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=" + username + "?access_token=" + twitteraccesstoken;
localStorage.setItem("link",twitterlink);
localStorage.getItem("link");
</script>
</body>
</html>
We can't get it to work as intended. Thanks in advance.
This should work, unless you're running it on your local machine, in which case local storage may not be enabled. If so, you should try to run it on your server.