Permalink
Browse files

hmm

  • Loading branch information...
1 parent df9b758 commit 79b40387dd6485dbf90ec2ed289b515f954633b1 @veverkap committed Nov 24, 2010
Showing with 33 additions and 1 deletion.
  1. +2 −1 .gitignore
  2. BIN DMDesktop/icons/user_preview.jpg
  3. +31 −0 DMDesktopWeb/callbackertest.php
View
@@ -4,4 +4,5 @@
ehthumbs.db
Icon?
Thumbs.db
-.tmp_?
+.tmp_?
+DMDesktop/.tmp_DMDesktop.html.33674~
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,31 @@
+<?php
+function curl_post($url, array $post = NULL, array $options = array())
+{
+ $defaults = array(
+ CURLOPT_POST => 1,
+ CURLOPT_HEADER => 0,
+ CURLOPT_URL => $url,
+ CURLOPT_FRESH_CONNECT => 1,
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_FORBID_REUSE => 1,
+ CURLOPT_TIMEOUT => 4,
+ CURLOPT_POSTFIELDS => http_build_query($post)
+ );
+
+ $ch = curl_init();
+ curl_setopt_array($ch, ($options + $defaults));
+ if( ! $result = curl_exec($ch))
+ {
+ trigger_error(curl_error($ch));
+ }
+ curl_close($ch);
+ return $result;
+}
+$a = array("grant_type" => "authorization_code",
+ "client_id" => "dk91QOkPgzChAP8oqBOB5gUKEk8afmDF7demeCtS",
+ "client_secret" => "8ZgPyMAk2VAWdIFc2qrTXT7lnQxZwVO0XEcvv3RW",
+ "redirect_uri" => "http://importerama.veverka.net/callback.php",
+ "code" => $_GET["code"]);
+$b = array();
+echo curl_post("https://api.dailymile.com/oauth/token", $a, $b);
+?>

0 comments on commit 79b4038

Please sign in to comment.