How do i autenticate my php code to use the https://api.twitter.com/1.1/users/lookup.json?screen_name=?


#1

I’m trying to use the new twitter api to get the id and user_profile_image, but i’m having problem with the auth, i need to use this URL: https://api.twitter.com/1.1/users/lookup.json?screen_name=

But it requires autentication, but i don’t know how to do it on PHP. My code is:

$url = get_data("https://api.twitter.com/1.1/users/lookup.json?screen_name=".$name);
		$xml = json_decode($url, true);
		$id = $xml[0][id];
		$av = $xml[0][profile_image_url];

Does anybody here knows how to do that??

Thank you very much


#2

You should use libraries like: