Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <?php
  2.  
  3. require 'instagram.class.php';
  4. require 'instagram.config.php';
  5.  
  6. // Receive OAuth code parameter
  7. $code = $_GET['code'];
  8.  
  9. // Check whether the user has granted access
  10. if (true === isset($code)) {
  11.  
  12. // Receive OAuth token object
  13. $data = $instagram->getOAuthToken($code );
  14.  
  15. if(empty($data->user->username))
  16. {
  17. echo "1";
  18.  
  19. }
  20. else
  21. {
  22. session_start();
  23. $_SESSION['userdetails']=$data;
  24. echo $user=$data->user->username;
  25. echo $fullname=$data->user->full_name;
  26. echo $bio=$data->user->bio;
  27. echo $website=$data->user->website;
  28. echo $id=$data->user->id;
  29. echo $token=$data->access_token;
  30.  
  31.  
  32. }
  33. }
  34. else
  35. {
  36. // Check whether an error occurred
  37. if (true === isset($_GET['error']))
  38. {
  39. echo 'An error occurred: '.$_GET['error_description'];
  40. }
  41.  
  42. }
  43.  
  44. ?>
  45.  
  46. session.save_handler = memcache
  47. session.save_path = "tcp://localhost:11211"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement