diff --git a/API_Twitter/userInfosFunctions.php b/API_Twitter/userInfosFunctions.php index e0982c4215646fc6d1c345edb11f1231df770325..e2dfbc3644f05d80dcf9c61c07fddfaa460d8e2d 100644 --- a/API_Twitter/userInfosFunctions.php +++ b/API_Twitter/userInfosFunctions.php @@ -1,9 +1,9 @@ <?php require_once('requestsFunctions.php'); -function getUserNbFollowers($id) { +function getUserScreenName($id) { $response = getUserById($id); - return $response->followers_count; + return $response->screen_name; } function getUserNbFollowers($id) { @@ -11,31 +11,18 @@ function getUserNbFollowers($id) { return $response->followers_count; } -function getUserProfilPictureURL($id) { +function getUserProfileImage($id) { $response = getUserById($id); return $response->profile_image_url; } +function getUserInfos($id) { + $response = getUserById($id); + $user = [ + "screen_name" => $response->screen_name, + "profile_image" => $response->profile_image_url, + "followers_count" => $response->followers_count + ]; + return $user; +} -$id = 813286; - -?> - - -<pre> - Nombre d'abonnées : - <?php - echo getUserNbFollowers($id); - - ?> -</pre> - -<pre> - <?php - print_r(getUserProfilPictureURL($id)); - - ?> -</pre> - -profil picture -<img src="<?php echo getUserProfilPictureURL($id) ?>" alt="profil_image"> \ No newline at end of file