thefinn93

Untitled

Aug 23rd, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?                                                                                                      
  2. require_once("../requests/library/Requests.php");                                                      
  3. Requests::register_autoloader();                                                                        
  4. $code = $_GET['code'];                                                                                  
  5. $client_id = "hax";                                                                          
  6. $client_secret = "moar_hax";                                                          
  7. echo "I got a code! <pre>".$code."</pre>";                                                              
  8. echo "Now I will try to do something with it:";                                                          
  9. $options = array('auth' => array($client_id, $client_secret));                                          
  10. //"Basic ".base64_encode($client_id.":".$client_secret));                                                
  11. $token_request = Requests::post("https://oauth.reddit.com/api/v1/access_token","grant_type=authorization_
  12. code&code=".$code."&redirect_uri=https%3A%2F%2Fwww.thefinn93.com%2Freddit%2Fcb&cleint_id=".$client_id, ar
  13. ray(), $options);                                                                                        
  14. echo "<hr>";
  15. echo "<pre>";
  16. print_r($token_request);
  17. ?>
Add Comment
Please, Sign In to add comment