Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tylerreinhart
tylerreinhart / gist:10781282
Created April 15, 2014 22:01
Toopher Ptyhon Example
import toopher
# Create an API object using your credentials
api = toopher.ToopherApi("<your consumer="" key="">", "<your consumer="" secret="">")
# Step 1 - Pair with their phone's Toopher app
pairing_status = api.pair("pairing phrase", "username@yourservice.com")
# Step 2 - Authenticate a log in
auth = api.authenticate(pairing_status.id, "my computer")
@tylerreinhart
tylerreinhart / toopher-python-pairing-example.py
Created April 17, 2014 21:43
Toopher Python Pairing Example
import toopher
# Create an API object using your credentials
api = toopher.ToopherApi("<your consumer="" key="">", "<your consumer="" secret="">")
# Step 1 - Pair with their phone's Toopher app
pairing_status = api.pair("pairing phrase", "username@yourservice.com")
@tylerreinhart
tylerreinhart / toopher-python-authenticating-example.py
Created April 17, 2014 21:50
Toopher Python Authentication Example
import toopher
# Create an API object using your credentials
api = toopher.ToopherApi("<your consumer="" key="">", "<your consumer="" secret="">")
auth = api.authenticate(pairing_status.id, "my computer")
# Once they've responded you can then check the status
auth_status = api.get_authentication_status(auth.id)
if (auth_status.pending == false and auth_status.granted == true):
@tylerreinhart
tylerreinhart / toopher-java-pairing-example.java
Created April 18, 2014 21:06
Toopher Java Pairing Example
import com.toopher.*;
// Create an API object using your credentials
ToopherApi api = new ToopherApi("<your consumer key>", "<your consumer secret>");
// Step 1 - Pair with their phone's Toopher app
PairingStatus pairing = api.pair("pairing phrase", "username@yourservice.com");
@tylerreinhart
tylerreinhart / toopher-java-authentication-example.java
Last active August 29, 2015 14:00
Toopher Java Authentication Example
import com.toopher.*;
// Create an API object using your credentials
ToopherApi api = new ToopherApi("<your consumer key>", "<your consumer secret>");
// Step 2 - Authenticate a log in
AuthenticationStatus auth = api.authenticate(pairing.id, "my computer");
// Once they've responded you can then check the status
AuthenticationStatus status = api.getAuthenticationStatus(auth.id);
@tylerreinhart
tylerreinhart / toopher-ruby-pairing-example.rb
Created April 18, 2014 21:11
Toopher Ruby Pairing Example
require 'toopher_api'
# Create an API object using your credentials
toopher = ToopherAPI.new("key", "secret")
# Step 1 - Pair with their phone's Toopher app
pairing = toopher.pair("pairing phrase", "username@yourservice.com")
@tylerreinhart
tylerreinhart / toopher-ruby-authentication-example.rb
Created April 18, 2014 21:12
Toopher Ruby Authentication Example
require 'toopher_api'
# Create an API object using your credentials
toopher = ToopherAPI.new("key", "secret")
# Authenticate a log in
auth_status = toopher.authenticate(pairing.id, 'my computer')
# Once they've responded you can then check the status
while auth_status.pending
@tylerreinhart
tylerreinhart / toopher-php-pairing-example.php
Created April 18, 2014 21:13
Toopher PHP Pairing Example
require_once("toopher_api.php");
// Create an API object using your credentials
$toopherApi = new ToopherAPI($key, $secret);
// Step 1 - Pair with their phone's Toopher app
$pairing = $toopherApi->pair("pairing phrase", "username@yourservice.com");
@tylerreinhart
tylerreinhart / toopher-php-authentication-example.php
Created April 18, 2014 21:15
Toopher PHP Authentication Example
require_once("toopher_api.php");
// Create an API object using your credentials
$toopherApi = new ToopherAPI($key, $secret);
// Authenticate a log in
$authStatus = $toopherApi->authenticate($pairingStatus['id'], "my computer");
// Once they've responded you can then check the status
while($authStatus['pending']){
@tylerreinhart
tylerreinhart / toopher-perl-pairing-example.pm
Created April 18, 2014 21:16
toopher-perl-pairing-example.com
use ToopherAPI
# Create an API object using your credentials
my $api = new ToopherApi("<your consumer key>", "<your consumer secret>");
# Step 1 - Pair with their phone's Toopher app
my $pairing_status = $api->pair("pairing phrase", "username@yourservice.com");