Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 25 lines (21 sloc) 0.653 kB
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
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
7 $title = $_POST['title'];
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
8 $description = $_POST['description'];
9 $link = $_POST['link'];
77a43a7 @jcleblanc use POST values instead of test
jcleblanc authored
10 $token = $_POST['token'];
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
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
38e9224 @jcleblanc additional checks for update post
jcleblanc authored
18 if ($title){
19 $suid = $yahoo_user->guid . time();
20 if ($yahoo_user->insertUpdate($suid, $title, $link, $description)){
21 echo "Update Successful";
22 }
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
23 }
77a43a7 @jcleblanc use POST values instead of test
jcleblanc authored
24 ?>
Something went wrong with that request. Please try again.