Problem with new API version. How to get last tweet of a user and number of his followers?


#1

Hello, this is my first post in the developers section. I’ve a problem.

When there was the 1.0 API version, I hadn’t any problem, but since it changed, a web built in PHP that I made, where you introduce the screen_name of a twitter account in a input and it gets the number of followers, following, tweets, the profile images, and the last tweet don’t work.

I’ve been looking for the problem to solve it, but I can’t find it. I think that it seems to be something related to the authentification.

For example, I introduce this url in my browser: http://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi and it says:

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

What’s that? How can I get the number of followers of a twitter acount and the last tweet?

This is the code that I used in my web:

<?php
$data = json_decode(file_get_contents(‘http://api.twitter.com/1.1/users/lookup.json?screen_name=’. $_GET[‘usuario’] .’’), true);
echo $data[0][‘statuses_count’];?>

And now it don’t runs.

Please help me. Thanks.