FOWA 09 - Open Strategy Applied


Published on

Overview of Yahoo! Developer Network and how the Open Strategy benefits developers and the web. Quick YQL overview with code samples.

Published in: Technology
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • FOWA 09 - Open Strategy Applied

    1. 1. Open Strategy :: Applied Dan Theurer – Yahoo! Developer Network FOWA, Miami
    2. 2. <ul><li>Yahoo Developer Network (YDN) </li></ul><ul><li>Open Source </li></ul><ul><li>Developer Tools </li></ul><ul><li>Data Services </li></ul><ul><li>Yahoo! Open Strategy (YOS) </li></ul><ul><li>YQL Code Samples </li></ul>Open Strategy :: Applied
    3. 3. <ul><li>YUI </li></ul><ul><li>Hadoop </li></ul><ul><li>Apache </li></ul><ul><li>PHP </li></ul><ul><li>Perl </li></ul><ul><li>MySQL </li></ul>YDN :: Open Source
    4. 4. <ul><li>YSlow </li></ul><ul><li>Pipes </li></ul><ul><li>Blueprint Mobile Widgets </li></ul>YDN :: Developer Tools
    5. 5. <ul><li>BOSS </li></ul><ul><li>Address Book </li></ul><ul><li>Flickr </li></ul>YDN :: Data Services
    6. 6. YOS :: Technology Stack
    7. 7. <ul><li>SQL-like syntax </li></ul><ul><li>Allows you to query (SELECT), filter (WHERE) and join (IN) data across WebServices. </li></ul><ul><li>Self Describing - SHOW, DESC table </li></ul><ul><li>Public / Private Data </li></ul><ul><li>Bindings for many YDN APIs </li></ul><ul><li>Can query external structured data (USE) </li></ul><ul><li> </li></ul>Yahoo! Query Language (YQL)
    8. 8. <query yahoo:count=&quot;46&quot; yahoo:created=&quot;2009-02-20T08:16:03Z&quot; yahoo:lang=&quot;en-US&quot; yahoo:updated=&quot;2009-02-20T08:16:03Z&quot; yahoo:uri=&quot;;> <results> <table>atom</table> <table>csv</table> <table>feed</table> <table></table> <table></table> <table></table> <table></table> <table></table> <table></table> <table>flickr.places</table> <table></table> <table>geo.places</table> <table>geo.places.ancestors</table> … </results> </query YQL :: SHOW tables
    9. 9. <query yahoo:count=&quot;1&quot; yahoo:created=&quot;2009-02-21T01:41:28Z&quot; yahoo:lang=&quot;en-US&quot; yahoo:updated=&quot;2009-02-21T01:41:28Z&quot; yahoo:uri=&quot;;> <results> <table name=&quot;”> <request> <select usesRemoteLimit=&quot;true”> <key name=&quot;machine_tags&quot; type=&quot;xs:string&quot;/> <key name=&quot;radius_units&quot; type=&quot;xs:string&quot;/> <key name=&quot;safe_search&quot; type=&quot;xs:string&quot;/> <key name=&quot;privacy_filter&quot; type=&quot;xs:string&quot;/> <key name=&quot;contacts&quot; type=&quot;xs:string&quot;/> <key name=&quot;tags&quot; type=&quot;xs:string&quot;/> <key name=&quot;place_id&quot; type=&quot;xs:string&quot;/> <key name=&quot;text&quot; type=&quot;xs:string&quot;/> … </select> </request> </table> </results> </query> YQL :: DESC
    10. 10. <query yahoo:count=&quot;6&quot; yahoo:created=&quot;2009-02-21T02:09:55Z&quot; yahoo:lang=&quot;en-US&quot; yahoo:updated=&quot;2009-02-21T02:09:55Z&quot; yahoo:uri=&quot;*;> <results> <photo farm=&quot;4&quot; id=&quot;3154107557&quot; isfamily=&quot;0&quot; isfriend=&quot;0&quot; ispublic=&quot;1&quot; owner=&quot;28569531@N00&quot; secret=&quot;6f22e677c3&quot; server=&quot;3101&quot; title=&quot;Jump - Fremont Older&quot;/> <photo farm=&quot;4&quot; id=&quot;2563123589&quot; isfamily=&quot;0&quot; isfriend=&quot;0&quot; ispublic=&quot;1&quot; owner=&quot;28569531@N00&quot; secret=&quot;7811c91934&quot; server=&quot;3087&quot; title=&quot;Jump&quot;/> <photo farm=&quot;3&quot; id=&quot;2159479534&quot; isfamily=&quot;0&quot; isfriend=&quot;0&quot; ispublic=&quot;1&quot; owner=&quot;28569531@N00&quot; secret=&quot;785e671cd4&quot; server=&quot;2080&quot; title=&quot;Hollywood - Jump - Dan&quot;/> <photo farm=&quot;3&quot; id=&quot;2066431773&quot; isfamily=&quot;0&quot; isfriend=&quot;0&quot; ispublic=&quot;1&quot; owner=&quot;28569531@N00&quot; secret=&quot;c61604d090&quot; server=&quot;2208&quot; title=&quot;JUMP!&quot;/> <photo farm=&quot;2&quot; id=&quot;1304849768&quot; isfamily=&quot;0&quot; isfriend=&quot;0&quot; ispublic=&quot;1&quot; owner=&quot;28569531@N00&quot; secret=&quot;7271c8f9b3&quot; server=&quot;1233&quot; title=&quot;Testing the suit&quot;/> <photo farm=&quot;2&quot; id=&quot;1178261094&quot; isfamily=&quot;0&quot; isfriend=&quot;0&quot; ispublic=&quot;1&quot; owner=&quot;28569531@N00&quot; secret=&quot;3dac28807f&quot; server=&quot;1241&quot; title=&quot;Jump, jump!&quot;/> </results> </query> YQL :: SELECT * FROM WHERE user_id=&quot;28569531@N00” AND text=&quot;jump” LIMIT 6
    11. 11. <ul><li>Download the SDK </li></ul><ul><ul><li> </li></ul></ul><ul><li>Unzip yos_php_sdk-1.1 </li></ul><ul><li>Get a Developer Key </li></ul><ul><ul><li> </li></ul></ul><ul><li>Start to write some code </li></ul>Developer Key / PHP SDK
    12. 12. <?php // Include the PHP SDK for YSP library. require_once(&quot;yosdk/lib/;); // Define values for keys required for authorization define(CONSUMER_KEY,&quot;dj0yJmk9ZDNwaXdQSEZ…j&quot;); define(CONSUMER_SECRET,&quot;37fe717538e0598e6c70d4262…&quot;); // The YahooApplication class is used for two-legged authorization, which doesn't need user authorization. $two_legged_app = new YahooApplication(CONSUMER_KEY,CONSUMER_SECRET); // Create queries for Flickr $yql_request = 'select * from where user_id=&quot;28569531@N00&quot; and text=&quot;jump&quot; limit 6'; // Make the request $results = $two_legged_app->query($yql_request); $photos = $results->query->results->photo; // Build the output HTML foreach($photos as $k=>$v) { $imgs .= '<img src=&quot;http://farm' . $v->farm . '' . $v->server . '/' . $v->id . '_' . $v->secret . '_m.jpg&quot; alt=&quot;Image' . $k . '&quot;/>' ; } echo &quot;<html><body>&quot; . $imgs . '</body></html>’; ?> YQL :: 2-legged OAuth – PHP SDK
    13. 13. YQL :: 2-legged OAuth – Result
    14. 14. <?php // Include the PHP SDK for YSP library. require_once(&quot;yosdk/lib/;); // Define values for keys required for authorization define(CONSUMER_KEY,&quot;dj0yJmk9ZDNwaXd…j&quot;); define(CONSUMER_SECRET,&quot;37fe717538e0598e6…&quot;); $session=YahooSession::requireSession(CONSUMER_KEY,CONSUMER_SECRET); // Define YQL queries for the Social Directory APIs $query = &quot;SELECT * FROM social.connections WHERE owner_guid=me LIMIT 2&quot;; $result = $session->query($query); // Build the output HTML echo(&quot;<html><body><pre><h2>Connection Data</h2>&quot; ); var_dump($result) ; echo(&quot;</pre></body></html>&quot;); ?> YQL :: 3-legged OAuth – PHP SDK
    15. 15. YQL :: 3-legged OAuth – Result
    16. 16. Thank You [email_address]
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.