Skip to content

Instantly share code, notes, and snippets.

@erikeldridge
Created May 18, 2010 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikeldridge/405188 to your computer and use it in GitHub Desktop.
Save erikeldridge/405188 to your computer and use it in GitHub Desktop.
<?php
// http://github.com/yahoo/yos-social-php5
require('../yosdk/yahoo-yos-social-php5-86eef28/lib/OAuth/OAuth.php');
require('../yosdk/yahoo-yos-social-php5-86eef28/lib/Yahoo/YahooOAuthApplication.class.php');
if( $_REQUEST['submit'] ){
$app = new YahooOauthApplication( $_REQUEST['key'], $_REQUEST['secret'], null, $_REQUEST['callback'] );
$token = $app->getRequestToken( $_REQUEST['callback'] );
$url = $app->getAuthorizationUrl( $token );
header("Location: $url");
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.1/build/reset-fonts-grids/reset-fonts-grids.css">
<style>
body {
padding: 20px;
}
button {
float: left;
background-color: #fff;
padding: 1ex;
margin: 2ex 0;
}
label {
display: block;
text-align: left;
width: 10em;
}
input {
float: left;
width: 64em;
padding: 1ex;
margin: 2ex 0;
}
#submit {
width: 7em;
}
</style>
</head>
<body>
<form>
<div>
<label>Consumer key:</label><input name="key" value="">
<div style="clear:both"/>
</div>
<div>
<label>Consumer secret:</label><input name="secret" value="">
<div style="clear:both"/>
</div>
<div>
<label>Callback URL:</label><input name="callback" value="">
<div style="clear:both"/>
</div>
<input value="Authorize" name="submit" type="submit" id="submit">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment