Skip to content
Newer
Older
100644 24 lines (20 sloc) 668 Bytes
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored Jul 17, 2009
1 <?php
2 require_once("config.php");
3 require_once("php_sdk/Yahoo.inc");
4 require_once("CustomSessionStore.inc");
5
6 //capture POST data for update
77a43a7 @jcleblanc use POST values instead of test
jcleblanc authored Jul 17, 2009
7 $title = $_POST['title'];
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored Jul 17, 2009
8 $description = $_POST['description'];
9 $link = $_POST['link'];
77a43a7 @jcleblanc use POST values instead of test
jcleblanc authored Jul 17, 2009
10 $token = $_POST['token'];
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored Jul 17, 2009
11
12 //initialize session
13 $sessionStore = new CustomSessionStore();
14 $session = YahooSession::initSession(KEY, SECRET, APPID, TRUE, CALLBACK, $sessionStore);
15 $yahoo_user = $session->getSessionedUser();
16
17 //create new update
18 if ($title && $description && $link){
19 $suid = $yahoo_user->guid . time();
20 $yahoo_user->insertUpdate($suid, $title, $link, $description);
21 echo "Update Successful";
22 }
77a43a7 @jcleblanc use POST values instead of test
jcleblanc authored Jul 17, 2009
23 ?>
Something went wrong with that request. Please try again.