This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$search_term = $_GET['search_term']; | |
if($search_term){ | |
//http://developer.yahoo.com/yql/console/?q=select%20*%20from%20search.web%20where%20query%3D%22pizza%22 | |
$yql_search_url = "http://query.yahooapis.com/v1/public/yql?" | |
."q=select%20*%20from%20search.web%20where%20query%3D%22$search_term%22&" | |
."format=json&diagnostics=false&callback="; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
require 'private.php'; | |
require 'gistfile1.php'; | |
$foo = new Foo(array( | |
'request_client' => new YahooCurlWrapper, | |
'oauth_client' => new StandardOauthClient, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function yql( $query ) | |
{ | |
$params = array( | |
'q' => $query, | |
'debug' => 'true', | |
'diagnostics' => 'true', | |
'format' => 'json', | |
'callback' => '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Software License Agreement (BSD License) Copyright (c) 2009, Yahoo! Inc. All rights reserved. | |
Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
- Neither the name of Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc. | |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// A util to do the OAuth dance and make signed requests using the YQL OAuth table (github.com/yql/yql-tables/raw/master/oauth/oauth.xml) | |
// usage: create an object above wherever you'll need to make a request, if the user doesn't have an token, it'll do the dance to get one, and store it in a cookie | |
// example: see the example.php file below | |
// license: http://gist.github.com/375593 | |
class YqlOauthMonkey { | |
function __construct ( $params ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// a web api for sqlitestore ( http://gist.github.com/373491 ) | |
// usage: GET retrieves data, POST inserts. Value to insert is validated as json before writing to store. | |
// example: http://github.com/erikeldridge/openid-oauth-yql-yui-party/blob/master/start.xml | |
// license: http://gist.github.com/375593 | |
require 'SqliteStore.php'; | |
$filters = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- A little yui 3 to launch popup | |
Usage: | |
1. mix this in w/ your html | |
2. click the "click" link | |
3. observe popup | |
License: Yahoo! BSD http://gist.github.com/375593 | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* A little wrapper for php's mysql handlers | |
Usage: | |
1) Drop this code on a page | |
2) Create a table as you like | |
3) Initialize an object like this: $db = new MysqlUtil( $db_host, $db_name, $db_user, $db_pass ); | |
4) Run queries like this: | |
$db->query( "select * from `my_table` where `field_name`='value';" ); | |
5) Escape input using sprintf notation & logic like this: | |
$db->query( "insert into `my_table` ( `field1` ) values ( '%s' )", "my ' value" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("../yosdk/yahoo-yos-social-php5-86eef28/lib/OAuth/OAuth.php"); | |
$consumer = new OAuthConsumer($_GET['cKeyInputField'], $_GET['cSecretInputField']); | |
$api_endpoint = 'http://test.erikeldridge.com/hak/cck.php'; | |
$params = array('pAppid' => $_REQUEST['pAppid']); | |
$params = array('name' => $_REQUEST['name']); | |
$params = array('description' => $_REQUEST['description']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a convenience function for making a call to YQL from Ruby | |
# License: Yahoo! BSD http://gist.github.com/375593 | |
# Usage: http://erikeldridge.wordpress.com/2010/02/18/ruby-yql-utility-function-example/ | |
require 'net/http' | |
require 'rubygems' | |
require 'json' | |
def yql(query) | |
uri = "http://query.yahooapis.com/v1/public/yql" |
OlderNewer