Skip to content

Instantly share code, notes, and snippets.

var accessor = {
consumerKey: 'your consumer token key,
consumerSecret: 'your consumer token secret',
token: 'your access/request token key',
tokenSecret: 'your access/request token secret'
};
var message = {
action: 'http://yoururl.com/endpoint',
method: 'GET',
<?php
/**
* A General purpose client for OAuth APIs
*
* @requires OAuth-php (http://oauth.googlecode.com/svn/code/php/) *
* @copyright OAuth.net (C) 2009
*/
/**
<?php
/**
* A Client for Campus Notes' (http://getcampusnotes.com) API
*
* @requires OAuth-php (http://oauth.googlecode.com/svn/code/php/) *
* @copyright Campus Notes (C) 2009
*/
/**
<?php
require 'OAuth.php';
$consumer = new OAuthConsumer('consumer-key', 'consumer-secret');
$token = new OAuthToken('token-key', 'token-secret'); // can be both request and access-token
// of course it needs to be an access-token to perform authorized request, but for the call to
// exchange your request-token for an access-token, this needs to be the request-token
<?php
/**
* A simple sample OAuth client implementation
*
* :NOTE: This is not Revision A. compliant. I haven't had the time to update it.
*
* :NOTE 2: This is adapted from a more specific-case client, and I haven't tested
* the generalization!
*
window.onload=function(no){var oo=window.onload;return function(){if(typeof oo=='function'){oo();}no();}}(function(ifAO){return function(){var im=document.getElementsByTagName('img');for(var i=0;i<im.length;i++){if(im[i].src&&im[i].src.match(/aoimages\.s3/)){return ifAO();}}}}(function() {
// Enter whatever JS you want run when AidOnline is detected..
alert('You have AidOnline - go away please!');
// End of your own JS..
}));
<?php
class ClassUnderTest {
private $table;
public function __construct( $table ) {
$this->table = $table;
}
public function lookup($key) {
<?php
class OAuthServerTest extends PHPUnit_Framework_TestCase {
public function testRejectInvalidConsumer() {
$unknown_consumer = new OAuthConsumer('unknown', '__unused__');
$stub = $this->getMock('OAuthDataStore');
$stub->expects($this->any())
->method('lookup_consumer')
<?php
header("Content-Type: text/plain; charset=UTF-8");
try {
// Fetch the server
$server = CNApi::getServer();
// Ask the server to handle the call
$output = $server->handleCall();
<?php
ini_set('soap.wsdl_cache_ttl', 0);
$client = new SoapClient('http://kvikbase.kvik.com:8080/webservices/KvikStores.php?wsdl');
$output = $client->get_employees_by_store( 67, 1 );
header("Content-Type: text/html;charset=UTF-8");
foreach( $output AS $emp ) {