This file contains hidden or 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 // simple example code for doing the OAuth dance w/ netflix in php | |
//http://oauth.net/code/ | |
//http://oauth.googlecode.com/svn/code/php/OAuth.php | |
require 'oauth.php'; | |
//key/secret from http://developer.netflix.com | |
$key = 'slkdjf298374'; | |
$secret = 'lskdjf0298374'; | |
$consumer = new OAuthConsumer($key, $secret); |
This file contains hidden or 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 super-stripped down 2-leg oauth server/client example | |
//http://oauth.net/code/ | |
//http://oauth.googlecode.com/svn/code/php/OAuth.php | |
require 'oauth.php'; | |
$key = 'key'; | |
$secret = 'secret'; | |
$consumer = new OAuthConsumer($key, $secret); | |
$sig_method = new OAuthSignatureMethod_HMAC_SHA1; |
This file contains hidden or 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
<!-- fetch flickr photos in javascript & put them on a page. Based on Jon LeBlanc's PHP code: http://developer.yahoo.net/blog/archives/2010/04/building_flickr_urls_from_yql_flickrphotossearch_results.html --> | |
<body> | |
<script> | |
function cbfunc(obj){ | |
for(var i = 0; i < obj.query.results.photo.length; i++){ | |
var farm = obj.query.results.photo[i].farm; | |
var server = obj.query.results.photo[i].server; | |
var id = obj.query.results.photo[i].id; | |
var secret = obj.query.results.photo[i].secret; |
This file contains hidden or 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 // sample code for making an oauth request using YAP OAuth credentials | |
// http://oauth.googlecode.com/svn/code/php/OAuth.php | |
require 'OAuth.php'; | |
// get key/secret from your app dashboard http://developer.apps.yahoo.com/projects | |
$key="exampleGWklXQ3FTSk1iJmQ9WVdrOVYyOVlhMjR4TnpnbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD0yNQ--"; | |
$secret="examplec1a002564a746354ff159380b9d689"; | |
$consumer = new OAuthConsumer($key, $secret); |
This file contains hidden or 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
<!-- Sample YAP code for consistent font formatting between small and large views --> | |
<!-- Usage and licensing info in http://gist.github.com/330606#file_readme.txt --> | |
<style> | |
#wrapper { | |
font-family: sans-serif; | |
font-size: 16pt; | |
} | |
</style> | |
<div id="wrapper"> |
This file contains hidden or 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 // Tabbed navigation for YAP small view | |
// See usage and license details in http://gist.github.com/327012/#file_readme.txt | |
?> | |
<? if('1' == $_GET['item']): ?> | |
this is item 1 content | |
<? elseif('2' == $_GET['item']): ?> | |
this is item 2 content | |
<? elseif('3' == $_GET['item']): ?> |
This file contains hidden or 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
<!-- Use YQL to convert XML to JSON in your sleep --> | |
<!-- Introduced in YDN blog post: http://developer.yahoo.net/blog/archives/2010/03/yql_code_samples_yql_is_easy_to_use.html --> | |
<script src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script> | |
<ul>UN Headlines:</ul> | |
<script> | |
var Y = new YUI(); | |
function handleResponse ( json ) { | |
var items = json.query.results.item; | |
for ( var i = 0; i < items.length; i++ ) { |
This file contains hidden or 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
<!-- Scrape content off the World Wildlife Fund's site and pass it back to a jQuery handler --> | |
<!-- Introduced in YDN blog post: http://developer.yahoo.net/blog/archives/2010/03/yql_code_samples_yql_is_easy_to_use.html --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script> | |
function cbfunc(json){ | |
$.each( json.query.results.h4, function ( i, h4 ) { | |
var div = $( '<div/>' ).text( h4.content ); | |
$.each( json.query.results.ul[i].li, function ( j, li ) { |
This file contains hidden or 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
<!-- Fetch Twitter search results using YQL + JSONP + a simple JavaScript handler function --> | |
<!-- Described in blog post: http://developer.yahoo.net/blog/archives/2010/03/yql_code_samples_yql_is_easy_to_use.html --> | |
<ul>Puppy Tweets:</ul> | |
<script> | |
function handleResponse (json) { | |
var results = json.query.results.json.results, | |
ul = document.getElementsByTagName( 'ul' )[0], | |
li = null; | |
for ( var i = 0; i < results.length; i++ ) { |
This file contains hidden or 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 // YML-based auto-rotating carousel for YAP | |
/* | |
Overview: | |
- This code displays a series of images and automatically rotates through them using yml | |
- This code was presented as part of a post on the YDN blog: http://developer.yahoo.net/blog/archives/2010/03/yap_sample_code_image_carousel_w_autorotation.html | |
Usage: | |
1. Put this file on your server | |
2. Create a YAP app and set the "Application URL" to the url of this file, eg http://example.com/rotator.php |