Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 29 lines (25 sloc) 0.824 kb
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
1 <?php
a58e5d8 added licensing
erik authored
2 /*
3 Copyright (c) 2009 Yahoo! Inc. All rights reserved.
4 The copyrights embodied in the content of this file are licensed under the BSD (revised) open source license
5 */
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
6 require_once("config.php");
7 require_once("php_sdk/Yahoo.inc");
8 require_once("CustomSessionStore.inc");
9
10 //capture POST data for update
77a43a7 @jcleblanc use POST values instead of test
jcleblanc authored
11 $title = $_POST['title'];
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
12 $description = $_POST['description'];
13 $link = $_POST['link'];
77a43a7 @jcleblanc use POST values instead of test
jcleblanc authored
14 $token = $_POST['token'];
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
15
16 //initialize session
17 $sessionStore = new CustomSessionStore();
18 $session = YahooSession::initSession(KEY, SECRET, APPID, TRUE, CALLBACK, $sessionStore);
19 $yahoo_user = $session->getSessionedUser();
20
21 //create new update
38e9224 @jcleblanc additional checks for update post
jcleblanc authored
22 if ($title){
23 $suid = $yahoo_user->guid . time();
24 if ($yahoo_user->insertUpdate($suid, $title, $link, $description)){
25 echo "Update Successful";
26 }
d4d101e @jcleblanc PHP OAuth flow with custom session store
jcleblanc authored
27 }
77a43a7 @jcleblanc use POST values instead of test
jcleblanc authored
28 ?>
Something went wrong with that request. Please try again.