Skip to content

Instantly share code, notes, and snippets.

@erikeldridge
erikeldridge / .gems
Created September 29, 2010 18:15
ruby rack script that calls y! aouth
oauth -v 0.4.3
json
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="http://yui.yahooapis.com/3.2.0pr2/build/simpleyui/simpleyui-min.js"></script>
<script type="text/javascript" src="http://isithackday.com/hacks/geo/yql-geo-library/yqlgeo.js"></script>
<style type="text/css">
#demo input {
width: 2em;
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Paul Tarjan</author>
<description>Facebook Graph API</description>
<documentationURL>http://graph.facebook.com</documentationURL>
<documentationURL>http://developers.facebook.com/docs/reference/api/page</documentationURL>
<sampleQuery>SELECT * FROM facebook.graph WHERE id='paul.tarjan'</sampleQuery>
<sampleQuery>SELECT * FROM facebook.graph WHERE id='facebook' AND connection='posts'</sampleQuery>
<sampleQuery>SELECT * FROM facebook.graph WHERE ids='4,6'</sampleQuery>
<sampleQuery>SELECT * FROM facebook.graph WHERE search='conference' AND type='event'</sampleQuery>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- <s cript type="text/javascript" src="http://yui.yahooapis.com/3.2.0pr2/build/simpleyui/simpleyui-min.js"></script> -->
<script type="text/javascript" src="http://isithackday.com/hacks/geo/yql-geo-library/yqlgeo.js"></script>
</head>
<body>
@erikeldridge
erikeldridge / gist:595988
Created September 24, 2010 20:31
basic yui 3 horiz slider
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Basic Sliders</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
<script src="http://yui.yahooapis.com/3.2.0/build/simpleyui/simpleyui-min.js"></script>
<script>
Y.one("#foo").addClass("highlight");
</script>
<?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'] );
@erikeldridge
erikeldridge / OAuthMonkey.php
Created May 18, 2010 07:02
a php script that uses the standard oauth lib to do the oauth dance
<?php // a php script that uses the standard oauth lib (via yos sdk) to do the oauth dance
/**
* Requirements:
* - PHP5
* - YOS PHP5 SDK: 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');
@erikeldridge
erikeldridge / yqlLogger.js
Created May 16, 2010 03:00
A convenience fn for adding meta data to the log in YQL
/**
* A convenience fn for adding meta data to the log in YQL
*
* Usage:
* 1) copy/paste this code into your YQL table's execute block
* 2) Edit the tableName var to match your table's name
* 3) To log the message 'aloha' on line 25, call the logger like this: logger( 'aloha', 25 );
* 4) Look in the diagnostics section of your YQL output to see the log entry
*
* License: Yahoo! BSD http://gist.github.com/375593
@erikeldridge
erikeldridge / openid_debug_util.php
Created May 15, 2010 00:48
PHP code for OpenID authentication w/ debug output
<?php // simple code to require OpenID authentication on a page
/*
Requirements:
* PHP 5
* OpenID Enabled PHP library (http://openidenabled.com/php-openid/)
Usage:
1) Put this code in a file on your server
2) Load the page in a browser