SlideShare una empresa de Scribd logo
1 de 60
Yahoo Social SDKs Jon LeBlanc + Dustin Whittle Yahoo! Developer Network
EXAMPLES | TUTORIALS | CODE SAMPLES developer.yahoo.com
Open applications are applications that run on the Yahoo! network: Yahoo! Homepage and My Yahoo! OAuth applications are standalone applications the run off the Yahoo! network.
SDK Prerequisites   ,[object Object]
cks = CONSUMER_SECRET
app = APPLICATION_ID
cb  = CALLBACK_URL,[object Object]
SDK Code DiveWhat can you do? 11
Yahoo! Social Apps – A good foundation Scalable Hosting Joyent – Free OpenSocial Accelerators Google App Engine Amazon EC2 + S3 Web App Framework PHP (symfony) Python (Django) Ruby (Rails)
What SDK Languages Are Available? PHP, Python, Java, ActionScript 3, Objective-C, and OpenSocial http://www.github.com/yahoo
Yahoo! Social SDK – Features ,[object Object]
Authenticating with OAuth
Fetching Profiles
Fetching and Inserting Updates
Fetching Connections
Executing YQL,[object Object]
For developing applications on social networksAccessing social data (profiles, connections) Fetching and inserting activities ,[object Object],Develop once, distribute broadly
Collecting User Data With OpenSocial 0.8 /* OpenSocial PERSON data request */ var req = opensocial.newDataRequest();  var params = {}; params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [ opensocial.Person.Field.NAME, opensocial.Person.Field.THUMBNAIL_URL ]; req.add(req.newFetchPersonRequest('VIEWER', params), 'viewer_profile'); req.send(response);
Collecting User Data With OpenSocial 0.8 /* response handler */ function response(data){    var viewer = data.get('viewer_profile').getData();    var aboutme =       viewer.getField(opensocial.Person.Field.NAME); }
PHP Example: OAuth Dance $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); var_dump($user);
PHP Example: Fetching Profile Data $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $profile = $user->getProfile(); var_dump($profile);
Python Example: OAuth Dance oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) # fetch unauthorized request token request_token = oauthapp.get_request_token(callback) # authorize request token authorization_url = oauthapp.get_authorization_url(request_token) # refresh authorized request token with access token access_token = oauthapp.get_access_token(request_token) oauthapp.token = access_token
Python Example: Fetching Profile Data oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) profile = oauthapp.getProfile() print profile
Yahoo! Updates
Getting Updates With OpenSocial 0.8 var req = opensocial.newDataRequest(); var spec = new opensocial.IdSpec(); spec.setField(opensocial.IdSpec.Field.USER_ID, opensocial.IdSpec.PersonId.OWNER); req.add(req.newFetchActivitiesRequest(spec), 'ownerActivities'); req.send(handleActivities);
Getting Updates With OpenSocial 0.8 function handleActivities(dataResponse) {     var ownerActivities = dataResponse.get('ownerActivities').getData();     //parse owner activities }
PHP Example: Fetching Updates $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $updates = $user->getUpdates(); var_dump($updates);
Python Example: Fetching Updates oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) updates = oauthapp.getUpdates()	 print updates
Inserting Updates with OpenSocial 0.8 var params = {}, activity; params[opensocial.Activity.Field.TITLE] = title; params[opensocial.Activity.Field.BODY] = body; activity = opensocial.newActivity(params); opensocial.requestCreateActivity( 	activity, 	opensocial.CreateActivityPriority.LOW, 	callback);
PHP Example: Inserting Updates $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $update = $user->insertUpdate($suid, $title, $link, $description); var_dump($update);
Python Example: Inserting Updates oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) update = oauthapp.insertUpdate(title, description, link) print update
Fetching Connections With OpenSocial 0.8 /* get owner and owner friends */ var idspec = opensocial.newIdSpec({ 'userId' : 'OWNER', 'groupId' : 'FRIENDS' }); var req = opensocial.newDataRequest(); req.add(req.newFetchPersonRequest('OWNER'), 'get_owner'); req.add(req.newFetchPeopleRequest(idspec), 'get_friends'); req.send(responseFriends);
Fetching Connections With OpenSocial 0.8 /* connection response function */ function responseFriends(data){     var owner = data.get('get_owner').getData();     var objFriends = data.get('get_friends').getData();     var html = 'Friends of ' +  owner.getDisplayName() + '<br />'; objFriends.each(function(person) {         html += person.getDisplayName() + '<br />';     });      }
PHP Example: Fetching Connections $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $connections = $user->getConnections(); var_dump($connections);
Python Example: Fetching Connections oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) connections = oauthapp.getConnections() print connections
The Yahoo! Query Language (YQL) SELECT myColumn, myTitle  FROM myTable WHERE col = 'value' AND var = 'title‘ LIMIT 3 OFFSET 10 | sort(field='myColumn') | reverse()
Getting Social Data with YQL  select * from social.profile where guid=me select * from social.connections where owner_guid=me select message from social.profile.status where guid=me select * from social.updates where guid=me
Making AJAX Requests With OpenSocial 0.8 var params = {}; var url = 'http://developer.yahoo.com/yql/console/?q=select%20*%20from%20flickr.photos.search%20where%20text%3D%22Times%20Square%22'  var callback = callbackFunc;  params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT; params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET; gadgets.io.makeRequest(url, callback, params);
Making AJAX Requests With OpenSocial 0.8 function callbackFunc(response){     if (response.text){         //use response.txt     } }
PHP Example: Executing YQL $application = new YahooApplication($key, $secret); $results = $application->query(‘select * from delicious.feeds.popular’); var_dump($results);
Python Example: Executing YQL oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) results = oauthapp.yql('select * from social.profile where guid=me') print results
Getting Started - Documentation Y!OS Main Overview - http://developer.yahoo.com/yos YAP Main Overview - http://developer.yahoo.com/yap YQL Docs - http://developer.yahoo.com/yql YML Docs - http://developer.yahoo.com/yap/yml YDN Forum – http://developer.yahoo.com/forum YAP Dashboard - http://developer.yahoo.com/dashboard YQL Console - http://developer.yahoo.com/yql/console Application Gallery - http://apps.yahoo.com/myapps JSLint - http://www.jslint.com Github SDKs – http://www.github.com/yahoo (yos-social-LANGUAGE) PHP SDK - http://developer.yahoo.com/social/sdk/ AS3 SDK - http://developer.yahoo.com/flash/yos/ Caja - http://code.google.com/p/google-caja/ Caja Guide - http://developer.yahoo.com/yap/guide/caja-support.html OpenSocial Spec - http://code.google.com/apis/opensocial
Yahoo! Social SDKs: Live Demo Joyent Accelerator + PHP SDK ,[object Object],Google App Engine + Python SDK ,[object Object],[object Object]
QUESTIONS? EXAMPLES | TUTORIALS | CODE SAMPLES developer.yahoo.com
ENJOY THE REST OF YAHOO! OPEN HACK DAY! EXAMPLES | TUTORIALS | CODE SAMPLES DEVELOPER.YAHOO.COM
Open Hack NYC Yahoo Social SDKs
Open Hack NYC Yahoo Social SDKs

Más contenido relacionado

Destacado

Yahoo! Open Hack Nyc Collateral Presentation Part 1
Yahoo! Open Hack Nyc Collateral Presentation Part 1Yahoo! Open Hack Nyc Collateral Presentation Part 1
Yahoo! Open Hack Nyc Collateral Presentation Part 1stephandouris
 
Yahoo! Open Hack Nyc Collateral Presentation Part 2
Yahoo! Open Hack Nyc Collateral Presentation Part 2Yahoo! Open Hack Nyc Collateral Presentation Part 2
Yahoo! Open Hack Nyc Collateral Presentation Part 2stephandouris
 
Fukuoka debianstudy02 / 福岡Debian勉強会 02
Fukuoka debianstudy02 / 福岡Debian勉強会 02Fukuoka debianstudy02 / 福岡Debian勉強会 02
Fukuoka debianstudy02 / 福岡Debian勉強会 02Aya Komuro
 
20130126 第2回福岡debian勉強会 debian wheezyとdebian installerのはなし
20130126 第2回福岡debian勉強会 debian wheezyとdebian installerのはなし20130126 第2回福岡debian勉強会 debian wheezyとdebian installerのはなし
20130126 第2回福岡debian勉強会 debian wheezyとdebian installerのはなしTsuyoshi Yamada
 
Things you can use (by the Yahoo Developer Network and friends)
Things you can use (by the Yahoo Developer Network and friends)Things you can use (by the Yahoo Developer Network and friends)
Things you can use (by the Yahoo Developer Network and friends)Christian Heilmann
 
Telling Your Story Through Branding
Telling Your Story Through BrandingTelling Your Story Through Branding
Telling Your Story Through BrandingImaginasium, Inc.
 
Good vs. Great Design
Good vs. Great DesignGood vs. Great Design
Good vs. Great DesignCameron Moll
 

Destacado (9)

Websites On Speed
Websites On SpeedWebsites On Speed
Websites On Speed
 
Yahoo! Open Hack Nyc Collateral Presentation Part 1
Yahoo! Open Hack Nyc Collateral Presentation Part 1Yahoo! Open Hack Nyc Collateral Presentation Part 1
Yahoo! Open Hack Nyc Collateral Presentation Part 1
 
Yahoo! Open Hack Nyc Collateral Presentation Part 2
Yahoo! Open Hack Nyc Collateral Presentation Part 2Yahoo! Open Hack Nyc Collateral Presentation Part 2
Yahoo! Open Hack Nyc Collateral Presentation Part 2
 
Fukuoka debianstudy02 / 福岡Debian勉強会 02
Fukuoka debianstudy02 / 福岡Debian勉強会 02Fukuoka debianstudy02 / 福岡Debian勉強会 02
Fukuoka debianstudy02 / 福岡Debian勉強会 02
 
20130126 第2回福岡debian勉強会 debian wheezyとdebian installerのはなし
20130126 第2回福岡debian勉強会 debian wheezyとdebian installerのはなし20130126 第2回福岡debian勉強会 debian wheezyとdebian installerのはなし
20130126 第2回福岡debian勉強会 debian wheezyとdebian installerのはなし
 
Things you can use (by the Yahoo Developer Network and friends)
Things you can use (by the Yahoo Developer Network and friends)Things you can use (by the Yahoo Developer Network and friends)
Things you can use (by the Yahoo Developer Network and friends)
 
Buletin de informare Iunie 2016
Buletin de informare Iunie 2016Buletin de informare Iunie 2016
Buletin de informare Iunie 2016
 
Telling Your Story Through Branding
Telling Your Story Through BrandingTelling Your Story Through Branding
Telling Your Story Through Branding
 
Good vs. Great Design
Good vs. Great DesignGood vs. Great Design
Good vs. Great Design
 

Similar a Open Hack NYC Yahoo Social SDKs

Hack u iitb_social
Hack u iitb_socialHack u iitb_social
Hack u iitb_socialRajesh Kumar
 
Foundations of a Social Application Platform
Foundations of a Social Application PlatformFoundations of a Social Application Platform
Foundations of a Social Application PlatformJonathan LeBlanc
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidAlberto Ruibal
 
Open Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialOpen Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialSaurabh Sahni
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela Fox
 
Nk API - examples
Nk API - examplesNk API - examples
Nk API - examplesnasza-klasa
 
The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009Chris Chabot
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Startedguest1af57e
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAravindharamanan S
 
Goodle Developer Days London 2008 - Open Social Update
Goodle Developer Days London 2008 - Open Social UpdateGoodle Developer Days London 2008 - Open Social Update
Goodle Developer Days London 2008 - Open Social UpdatePatrick Chanezon
 
Google Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocialGoogle Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocialPatrick Chanezon
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013Kiril Iliev
 
Android Intermediatte IAK full
Android Intermediatte IAK fullAndroid Intermediatte IAK full
Android Intermediatte IAK fullAhmad Arif Faizin
 

Similar a Open Hack NYC Yahoo Social SDKs (20)

Hack u iitb_social
Hack u iitb_socialHack u iitb_social
Hack u iitb_social
 
SEA Open Hack - YAP
SEA Open Hack - YAPSEA Open Hack - YAP
SEA Open Hack - YAP
 
YAP / Open Mail Overview
YAP / Open Mail OverviewYAP / Open Mail Overview
YAP / Open Mail Overview
 
Foundations of a Social Application Platform
Foundations of a Social Application PlatformFoundations of a Social Application Platform
Foundations of a Social Application Platform
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 
Open social
Open socialOpen social
Open social
 
Open Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialOpen Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! Social
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
 
Hi5 Open Social
Hi5   Open SocialHi5   Open Social
Hi5 Open Social
 
Api
ApiApi
Api
 
Nk API - examples
Nk API - examplesNk API - examples
Nk API - examples
 
The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codes
 
Yql hacku iitd_2012
Yql hacku iitd_2012Yql hacku iitd_2012
Yql hacku iitd_2012
 
Goodle Developer Days London 2008 - Open Social Update
Goodle Developer Days London 2008 - Open Social UpdateGoodle Developer Days London 2008 - Open Social Update
Goodle Developer Days London 2008 - Open Social Update
 
Google Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocialGoogle Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocial
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 
Android Intermediatte IAK full
Android Intermediatte IAK fullAndroid Intermediatte IAK full
Android Intermediatte IAK full
 
Android intermediatte Full
Android intermediatte FullAndroid intermediatte Full
Android intermediatte Full
 

Último

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Último (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Open Hack NYC Yahoo Social SDKs

  • 1. Yahoo Social SDKs Jon LeBlanc + Dustin Whittle Yahoo! Developer Network
  • 2. EXAMPLES | TUTORIALS | CODE SAMPLES developer.yahoo.com
  • 3.
  • 4. Open applications are applications that run on the Yahoo! network: Yahoo! Homepage and My Yahoo! OAuth applications are standalone applications the run off the Yahoo! network.
  • 5.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. SDK Code DiveWhat can you do? 11
  • 14. Yahoo! Social Apps – A good foundation Scalable Hosting Joyent – Free OpenSocial Accelerators Google App Engine Amazon EC2 + S3 Web App Framework PHP (symfony) Python (Django) Ruby (Rails)
  • 15.
  • 16. What SDK Languages Are Available? PHP, Python, Java, ActionScript 3, Objective-C, and OpenSocial http://www.github.com/yahoo
  • 17.
  • 22.
  • 23.
  • 24.
  • 25. Collecting User Data With OpenSocial 0.8 /* OpenSocial PERSON data request */ var req = opensocial.newDataRequest(); var params = {}; params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [ opensocial.Person.Field.NAME, opensocial.Person.Field.THUMBNAIL_URL ]; req.add(req.newFetchPersonRequest('VIEWER', params), 'viewer_profile'); req.send(response);
  • 26. Collecting User Data With OpenSocial 0.8 /* response handler */ function response(data){ var viewer = data.get('viewer_profile').getData(); var aboutme = viewer.getField(opensocial.Person.Field.NAME); }
  • 27. PHP Example: OAuth Dance $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); var_dump($user);
  • 28.
  • 29.
  • 30. PHP Example: Fetching Profile Data $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $profile = $user->getProfile(); var_dump($profile);
  • 31. Python Example: OAuth Dance oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) # fetch unauthorized request token request_token = oauthapp.get_request_token(callback) # authorize request token authorization_url = oauthapp.get_authorization_url(request_token) # refresh authorized request token with access token access_token = oauthapp.get_access_token(request_token) oauthapp.token = access_token
  • 32. Python Example: Fetching Profile Data oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) profile = oauthapp.getProfile() print profile
  • 34. Getting Updates With OpenSocial 0.8 var req = opensocial.newDataRequest(); var spec = new opensocial.IdSpec(); spec.setField(opensocial.IdSpec.Field.USER_ID, opensocial.IdSpec.PersonId.OWNER); req.add(req.newFetchActivitiesRequest(spec), 'ownerActivities'); req.send(handleActivities);
  • 35. Getting Updates With OpenSocial 0.8 function handleActivities(dataResponse) { var ownerActivities = dataResponse.get('ownerActivities').getData(); //parse owner activities }
  • 36. PHP Example: Fetching Updates $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $updates = $user->getUpdates(); var_dump($updates);
  • 37. Python Example: Fetching Updates oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) updates = oauthapp.getUpdates() print updates
  • 38. Inserting Updates with OpenSocial 0.8 var params = {}, activity; params[opensocial.Activity.Field.TITLE] = title; params[opensocial.Activity.Field.BODY] = body; activity = opensocial.newActivity(params); opensocial.requestCreateActivity( activity, opensocial.CreateActivityPriority.LOW, callback);
  • 39. PHP Example: Inserting Updates $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $update = $user->insertUpdate($suid, $title, $link, $description); var_dump($update);
  • 40. Python Example: Inserting Updates oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) update = oauthapp.insertUpdate(title, description, link) print update
  • 41. Fetching Connections With OpenSocial 0.8 /* get owner and owner friends */ var idspec = opensocial.newIdSpec({ 'userId' : 'OWNER', 'groupId' : 'FRIENDS' }); var req = opensocial.newDataRequest(); req.add(req.newFetchPersonRequest('OWNER'), 'get_owner'); req.add(req.newFetchPeopleRequest(idspec), 'get_friends'); req.send(responseFriends);
  • 42. Fetching Connections With OpenSocial 0.8 /* connection response function */ function responseFriends(data){ var owner = data.get('get_owner').getData(); var objFriends = data.get('get_friends').getData(); var html = 'Friends of ' + owner.getDisplayName() + '<br />'; objFriends.each(function(person) { html += person.getDisplayName() + '<br />'; });      }
  • 43. PHP Example: Fetching Connections $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $connections = $user->getConnections(); var_dump($connections);
  • 44. Python Example: Fetching Connections oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) connections = oauthapp.getConnections() print connections
  • 45.
  • 46.
  • 47. The Yahoo! Query Language (YQL) SELECT myColumn, myTitle FROM myTable WHERE col = 'value' AND var = 'title‘ LIMIT 3 OFFSET 10 | sort(field='myColumn') | reverse()
  • 48. Getting Social Data with YQL select * from social.profile where guid=me select * from social.connections where owner_guid=me select message from social.profile.status where guid=me select * from social.updates where guid=me
  • 49. Making AJAX Requests With OpenSocial 0.8 var params = {}; var url = 'http://developer.yahoo.com/yql/console/?q=select%20*%20from%20flickr.photos.search%20where%20text%3D%22Times%20Square%22' var callback = callbackFunc; params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT; params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET; gadgets.io.makeRequest(url, callback, params);
  • 50. Making AJAX Requests With OpenSocial 0.8 function callbackFunc(response){ if (response.text){ //use response.txt } }
  • 51. PHP Example: Executing YQL $application = new YahooApplication($key, $secret); $results = $application->query(‘select * from delicious.feeds.popular’); var_dump($results);
  • 52. Python Example: Executing YQL oauthapp = yahoo.application.OAuthApplication(key, secret, app_id, callback) results = oauthapp.yql('select * from social.profile where guid=me') print results
  • 53. Getting Started - Documentation Y!OS Main Overview - http://developer.yahoo.com/yos YAP Main Overview - http://developer.yahoo.com/yap YQL Docs - http://developer.yahoo.com/yql YML Docs - http://developer.yahoo.com/yap/yml YDN Forum – http://developer.yahoo.com/forum YAP Dashboard - http://developer.yahoo.com/dashboard YQL Console - http://developer.yahoo.com/yql/console Application Gallery - http://apps.yahoo.com/myapps JSLint - http://www.jslint.com Github SDKs – http://www.github.com/yahoo (yos-social-LANGUAGE) PHP SDK - http://developer.yahoo.com/social/sdk/ AS3 SDK - http://developer.yahoo.com/flash/yos/ Caja - http://code.google.com/p/google-caja/ Caja Guide - http://developer.yahoo.com/yap/guide/caja-support.html OpenSocial Spec - http://code.google.com/apis/opensocial
  • 54.
  • 55.
  • 56.
  • 57. QUESTIONS? EXAMPLES | TUTORIALS | CODE SAMPLES developer.yahoo.com
  • 58. ENJOY THE REST OF YAHOO! OPEN HACK DAY! EXAMPLES | TUTORIALS | CODE SAMPLES DEVELOPER.YAHOO.COM

Notas del editor

  1. OAuth is an open protocol, initiated by Blaine Cook and Chris Messina, to allow secure API authorization in a simple and standard method for desktop, mobile and web applications.For consumer developers, OAuth is a method to publish and interact with protected data. For service provider developers, OAuth gives users access to their data while protecting their account credentials. In other words, OAuth allows a user to grant access to their information on one site (the Service Provider), to another site (called Consumer), without sharing all of his or her identity.
  2. Missed connections, this is how you find them.
  3. Y!OS Main Overview - http://developer.yahoo.com/yosYAP Main Overview - http://developer.yahoo.com/yapYQL Docs - http://developer.yahoo.com/yqlYML Docs - http://developer.yahoo.com/yap/ymlYDN Forum - http://developer.yahoo.com/forumYAP Dashboard - http://developer.yahoo.com/dashboardYQL Console - http://developer.yahoo.com/yql/consoleApplication Gallery - http://apps.yahoo.com/myappsJSLint - http://www.jslint.comPHP SDK - http://developer.yahoo.com/social/sdk/AS3 SDK - http://developer.yahoo.com/flash/yos/Caja - http://code.google.com/p/google-caja/Caja Support - http://developer.yahoo.com/yap/guide/caja-support.html