SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Party Like It’s 1984
An introduction to social APIs


Jeff Siarto
Co-founder, Loudpixel
APIs are how machines read the web
What are APIs?
★   “Application Programming Interface”
★   We’re talking about web APIs
★   Gives web apps an “interface” for
    interacting with other software
★   Typically returns data in structured
    formats like XML and JSON (Jason?)
APIs are structured
★   Don’t confuse APIs with crawlers and
    robots (GoogleBot)
★   APIs deal with structured data (a user
    has an name, email and phone)
★   Data is available in a specified format
    and is usually documented
JSON
{
    "first_name": "Jeff",
    "last_name": "Siarto",
    "titles": [
        "Partner",
        "Analyst",
        "Designer"
    ],
    "online": {
        "website": "http://siarto.com",
        "twitter": "@jsiarto",
        "github": "http://github.com/jsiarto"
    }
}
XML
<?xml version="1.0" encoding="UTF-8"?>
   <first_name>Jeff</first_name>
   <last_name>Siarto</last_name>
   <titles>
       <title>Partner</title>
       <title>Analyst</title>
       <title>Designer</title>
   </titles>
   <online>
       <website>http://siarto.com</website>
       <twitter>@jsiarto</twitter>
       <github>http://github.com/jsiarto</github>
   </online>
REST
★   Representational State Transfer
★   The web is built to utilize REST
★   Stateless
★   HTTP verbs: GET, POST, PUT, DELETE
RESTful Web Services
★   Representational State Transfer
★   The web is built to utilize REST
★   Stateless
★   HTTP verbs: GET, POST, PUT, DELETE
APIs make the social web work
Telescreen
Telescreen
★   Rails 2.3.8
★   Basic mashup using RapLeaf, Twitter,
    Gravatar and Google Maps
★   Search proletarians (users) by email
RapLeaf
# environment.rb
config.gem “rapleaf_api”

# controller
rapleaf = RapleafApi::Api.new(‘API_KEY’)

# find a person
@person = rapleaf.query(:type => :person, :opts =>
{:email => ‘steve@apple.com’})

# view
@person.location # Chicago, Illinois, United States
RapLeaf Data
★   Basics: name, age, gender, location,
    occupations, schools, earliest/latest
    activity, friend count
★   Site Memberships: bebo, facebook, flickr,
    friendster, hi5, linkedin, livejournal,
    multiply, myspace, myyearbook, plaxo,
    twitter
Gravatar
# top of controller
require ‘md5’

# controller method
# MD5 hash the user email address
email_hash = MD5.new(params[:prole])

# build a gravatar URI
@gravatar = "http://www.gravatar.com/avatar/#
{email_hash}?s=150"

# view
image_tag @gravatar
Google Maps
# build a google maps URI
image_tag("http://maps.google.com/maps/api/staticmap?
center=#{url_for(@person.location)}
&zoom=12&size=256x256&maptype=roadmap&sensor=false")
# URI base
http://maps.google.com/maps/api/

# map position and location
staticmap?center=#{url_for(@person.location)}

# zoom and size
&zoom=12&size=256x256

# map type and sensor
&maptype=roadmap&sensor=false
Twitter
# top of controller
require 'net/http'
require 'uri'

# Parse Twitter username from RapLeaf
twitter_handle = @person.memberships(:primary)[12]
["profile_url"].gsub("http://twitter.com/", "")
unless twitter_handle.nil?

# Construct URI
uri = URI.parse("http://twitter.com/status/
user_timeline/#{twitter_handle}.json?count=3")

# Get JSON
@twitter = Net::HTTP.get_response(uri)

# Make JSON a Ruby object
@tweets = ActiveSupport::JSON.decode(@twitter.body)
# view
@tweets[0]['user']["description"]

# loop through tweets with .each
<% @tweets.each do |t| %>
  <li>
    <%= t['text'] %><br /><span class="status-url"><
%= link_to(t['created_at'], "http://twitter.com/#{t
['user']['screen_name']}/status/#{t['id']}") %></a>
  </li>
<% end %>
http://twitter.com/status/user_timeline/jsiarto.json?count=3
Thanks!
Jeff Siarto (jsiarto)
Co-founder, Loudpixel

Contenu connexe

En vedette

Using Social Media to Activate Local Communities
Using Social Media to Activate Local CommunitiesUsing Social Media to Activate Local Communities
Using Social Media to Activate Local CommunitiesSocialDevCamp Chicago
 
Insurance Coverage for NEFA
Insurance Coverage for NEFAInsurance Coverage for NEFA
Insurance Coverage for NEFARick Snow
 
Competencia de novillos en Houston 2016
Competencia de novillos en Houston 2016Competencia de novillos en Houston 2016
Competencia de novillos en Houston 2016Bionutrix S.A.
 
A Patient of Privilege Speaks Up and Asks the Question "What if?" presented a...
A Patient of Privilege Speaks Up and Asks the Question "What if?" presented a...A Patient of Privilege Speaks Up and Asks the Question "What if?" presented a...
A Patient of Privilege Speaks Up and Asks the Question "What if?" presented a...Darci Graves
 
Cloud Computing - Technology Radar 2015 / Apr 27th 2015
Cloud Computing - Technology Radar 2015 / Apr 27th 2015Cloud Computing - Technology Radar 2015 / Apr 27th 2015
Cloud Computing - Technology Radar 2015 / Apr 27th 2015Lothar Wieske
 

En vedette (7)

Using Social Media to Activate Local Communities
Using Social Media to Activate Local CommunitiesUsing Social Media to Activate Local Communities
Using Social Media to Activate Local Communities
 
Insurance Coverage for NEFA
Insurance Coverage for NEFAInsurance Coverage for NEFA
Insurance Coverage for NEFA
 
Competencia de novillos en Houston 2016
Competencia de novillos en Houston 2016Competencia de novillos en Houston 2016
Competencia de novillos en Houston 2016
 
Electoral College
Electoral CollegeElectoral College
Electoral College
 
Poemas frutos
Poemas frutosPoemas frutos
Poemas frutos
 
A Patient of Privilege Speaks Up and Asks the Question "What if?" presented a...
A Patient of Privilege Speaks Up and Asks the Question "What if?" presented a...A Patient of Privilege Speaks Up and Asks the Question "What if?" presented a...
A Patient of Privilege Speaks Up and Asks the Question "What if?" presented a...
 
Cloud Computing - Technology Radar 2015 / Apr 27th 2015
Cloud Computing - Technology Radar 2015 / Apr 27th 2015Cloud Computing - Technology Radar 2015 / Apr 27th 2015
Cloud Computing - Technology Radar 2015 / Apr 27th 2015
 

Similaire à Jeff Siarto: Party Like It’s 1984, An introduction to social APIs

Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Manish Pandit
 
Build APIs With Kapow Mashup Server
Build APIs With Kapow Mashup ServerBuild APIs With Kapow Mashup Server
Build APIs With Kapow Mashup ServerAndreas Krohn
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsJorge Ferrer
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django MeetupMike Malone
 
Tools, Frameworks, & Swift for iOS
Tools, Frameworks, & Swift for iOSTools, Frameworks, & Swift for iOS
Tools, Frameworks, & Swift for iOSTeri Grossheim
 
A high profile project with Symfony and API Platform: beIN SPORTS
A high profile project with Symfony and API Platform: beIN SPORTSA high profile project with Symfony and API Platform: beIN SPORTS
A high profile project with Symfony and API Platform: beIN SPORTSSmile I.T is open
 
Building native mobile apps with word press
Building native mobile apps with word pressBuilding native mobile apps with word press
Building native mobile apps with word pressNikhil Vishnu P.V
 
Designing a beautiful REST json api
Designing a beautiful REST json apiDesigning a beautiful REST json api
Designing a beautiful REST json api0x07de
 
API Product Opportunity Responsibility Nicolas Sierro 2015.pptx
API Product Opportunity Responsibility Nicolas Sierro 2015.pptxAPI Product Opportunity Responsibility Nicolas Sierro 2015.pptx
API Product Opportunity Responsibility Nicolas Sierro 2015.pptxBlockchainizator
 
Graph Analysis over JSON, Larus
Graph Analysis over JSON, LarusGraph Analysis over JSON, Larus
Graph Analysis over JSON, LarusNeo4j
 
Yahoo! BOSS in Bucharest
Yahoo! BOSS in BucharestYahoo! BOSS in Bucharest
Yahoo! BOSS in BucharestTed Drake
 
Unlock dependency between client teams and API team with API mock and proxy
Unlock dependency between client teams and API team with API mock and proxyUnlock dependency between client teams and API team with API mock and proxy
Unlock dependency between client teams and API team with API mock and proxyBruce Li
 
Creating an API with Expressive
Creating an API with ExpressiveCreating an API with Expressive
Creating an API with ExpressiveElton Minetto
 
Mashup University 4: Intro To Mashups
Mashup University 4: Intro To MashupsMashup University 4: Intro To Mashups
Mashup University 4: Intro To MashupsJohn Herren
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsTessa Mero
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsTessa Mero
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful ApproachMushfekur Rahman
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...Codemotion
 

Similaire à Jeff Siarto: Party Like It’s 1984, An introduction to social APIs (20)

Hi5 Open Social
Hi5   Open SocialHi5   Open Social
Hi5 Open Social
 
Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2
 
Build APIs With Kapow Mashup Server
Build APIs With Kapow Mashup ServerBuild APIs With Kapow Mashup Server
Build APIs With Kapow Mashup Server
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django Meetup
 
Tools, Frameworks, & Swift for iOS
Tools, Frameworks, & Swift for iOSTools, Frameworks, & Swift for iOS
Tools, Frameworks, & Swift for iOS
 
A high profile project with Symfony and API Platform: beIN SPORTS
A high profile project with Symfony and API Platform: beIN SPORTSA high profile project with Symfony and API Platform: beIN SPORTS
A high profile project with Symfony and API Platform: beIN SPORTS
 
Building native mobile apps with word press
Building native mobile apps with word pressBuilding native mobile apps with word press
Building native mobile apps with word press
 
Designing a beautiful REST json api
Designing a beautiful REST json apiDesigning a beautiful REST json api
Designing a beautiful REST json api
 
API Product Opportunity Responsibility Nicolas Sierro 2015.pptx
API Product Opportunity Responsibility Nicolas Sierro 2015.pptxAPI Product Opportunity Responsibility Nicolas Sierro 2015.pptx
API Product Opportunity Responsibility Nicolas Sierro 2015.pptx
 
Graph Analysis over JSON, Larus
Graph Analysis over JSON, LarusGraph Analysis over JSON, Larus
Graph Analysis over JSON, Larus
 
Yahoo! BOSS in Bucharest
Yahoo! BOSS in BucharestYahoo! BOSS in Bucharest
Yahoo! BOSS in Bucharest
 
Unlock dependency between client teams and API team with API mock and proxy
Unlock dependency between client teams and API team with API mock and proxyUnlock dependency between client teams and API team with API mock and proxy
Unlock dependency between client teams and API team with API mock and proxy
 
Creating an API with Expressive
Creating an API with ExpressiveCreating an API with Expressive
Creating an API with Expressive
 
Mashup University 4: Intro To Mashups
Mashup University 4: Intro To MashupsMashup University 4: Intro To Mashups
Mashup University 4: Intro To Mashups
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful Approach
 
xAPI Vocabulary - Improving Semantic Interoperability of Controlled Vocabularies
xAPI Vocabulary - Improving Semantic Interoperability of Controlled VocabulariesxAPI Vocabulary - Improving Semantic Interoperability of Controlled Vocabularies
xAPI Vocabulary - Improving Semantic Interoperability of Controlled Vocabularies
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
 

Plus de SocialDevCamp Chicago

Pete Simon: "Why do I even care?" Designing For the Skeptical User & For Your...
Pete Simon: "Why do I even care?" Designing For the Skeptical User & For Your...Pete Simon: "Why do I even care?" Designing For the Skeptical User & For Your...
Pete Simon: "Why do I even care?" Designing For the Skeptical User & For Your...SocialDevCamp Chicago
 
SocialDevCamp Chicago Intermission Slideshow
SocialDevCamp Chicago Intermission SlideshowSocialDevCamp Chicago Intermission Slideshow
SocialDevCamp Chicago Intermission SlideshowSocialDevCamp Chicago
 
Brad Flora: How to not suck at online advertising and publishing
Brad Flora: How to not suck at online advertising and publishingBrad Flora: How to not suck at online advertising and publishing
Brad Flora: How to not suck at online advertising and publishingSocialDevCamp Chicago
 
Ben Huh Keynote: LOLcats, FAILS, and Other Blunders from the Cheezburger Network
Ben Huh Keynote: LOLcats, FAILS, and Other Blunders from the Cheezburger NetworkBen Huh Keynote: LOLcats, FAILS, and Other Blunders from the Cheezburger Network
Ben Huh Keynote: LOLcats, FAILS, and Other Blunders from the Cheezburger NetworkSocialDevCamp Chicago
 
SocialDevCamp Chicago Introductory Slides - Sunday
SocialDevCamp Chicago Introductory Slides - SundaySocialDevCamp Chicago Introductory Slides - Sunday
SocialDevCamp Chicago Introductory Slides - SundaySocialDevCamp Chicago
 
SocialDevCamp Chicago Introductory Slides - Saturday
SocialDevCamp Chicago Introductory Slides - SaturdaySocialDevCamp Chicago Introductory Slides - Saturday
SocialDevCamp Chicago Introductory Slides - SaturdaySocialDevCamp Chicago
 
Elements Of Viral Twitter Applications
Elements Of Viral Twitter ApplicationsElements Of Viral Twitter Applications
Elements Of Viral Twitter ApplicationsSocialDevCamp Chicago
 
Social Media in Government and Politics
Social Media in Government and PoliticsSocial Media in Government and Politics
Social Media in Government and PoliticsSocialDevCamp Chicago
 

Plus de SocialDevCamp Chicago (13)

Pete Simon: "Why do I even care?" Designing For the Skeptical User & For Your...
Pete Simon: "Why do I even care?" Designing For the Skeptical User & For Your...Pete Simon: "Why do I even care?" Designing For the Skeptical User & For Your...
Pete Simon: "Why do I even care?" Designing For the Skeptical User & For Your...
 
Harper Reed: Cloud Contraints
Harper Reed: Cloud ContraintsHarper Reed: Cloud Contraints
Harper Reed: Cloud Contraints
 
SocialDevCamp Chicago Intermission Slideshow
SocialDevCamp Chicago Intermission SlideshowSocialDevCamp Chicago Intermission Slideshow
SocialDevCamp Chicago Intermission Slideshow
 
Brad Flora: How to not suck at online advertising and publishing
Brad Flora: How to not suck at online advertising and publishingBrad Flora: How to not suck at online advertising and publishing
Brad Flora: How to not suck at online advertising and publishing
 
Ben Huh Keynote: LOLcats, FAILS, and Other Blunders from the Cheezburger Network
Ben Huh Keynote: LOLcats, FAILS, and Other Blunders from the Cheezburger NetworkBen Huh Keynote: LOLcats, FAILS, and Other Blunders from the Cheezburger Network
Ben Huh Keynote: LOLcats, FAILS, and Other Blunders from the Cheezburger Network
 
SocialDevCamp Chicago Introductory Slides - Sunday
SocialDevCamp Chicago Introductory Slides - SundaySocialDevCamp Chicago Introductory Slides - Sunday
SocialDevCamp Chicago Introductory Slides - Sunday
 
SocialDevCamp Chicago Introductory Slides - Saturday
SocialDevCamp Chicago Introductory Slides - SaturdaySocialDevCamp Chicago Introductory Slides - Saturday
SocialDevCamp Chicago Introductory Slides - Saturday
 
Marketing The Future
Marketing The FutureMarketing The Future
Marketing The Future
 
Marketing The Future
Marketing The FutureMarketing The Future
Marketing The Future
 
The FTC Tackles New Media
The FTC Tackles New MediaThe FTC Tackles New Media
The FTC Tackles New Media
 
Elements Of Viral Twitter Applications
Elements Of Viral Twitter ApplicationsElements Of Viral Twitter Applications
Elements Of Viral Twitter Applications
 
Unerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIsUnerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIs
 
Social Media in Government and Politics
Social Media in Government and PoliticsSocial Media in Government and Politics
Social Media in Government and Politics
 

Dernier

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
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
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
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
 
[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
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
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
 
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
 
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
 
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
 
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
 

Dernier (20)

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
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
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
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
 
[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
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
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
 
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
 
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...
 
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
 
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...
 

Jeff Siarto: Party Like It’s 1984, An introduction to social APIs

  • 1. Party Like It’s 1984 An introduction to social APIs Jeff Siarto Co-founder, Loudpixel
  • 2. APIs are how machines read the web
  • 3. What are APIs? ★ “Application Programming Interface” ★ We’re talking about web APIs ★ Gives web apps an “interface” for interacting with other software ★ Typically returns data in structured formats like XML and JSON (Jason?)
  • 4. APIs are structured ★ Don’t confuse APIs with crawlers and robots (GoogleBot) ★ APIs deal with structured data (a user has an name, email and phone) ★ Data is available in a specified format and is usually documented
  • 5. JSON { "first_name": "Jeff", "last_name": "Siarto", "titles": [ "Partner", "Analyst", "Designer" ], "online": { "website": "http://siarto.com", "twitter": "@jsiarto", "github": "http://github.com/jsiarto" } }
  • 6. XML <?xml version="1.0" encoding="UTF-8"?> <first_name>Jeff</first_name> <last_name>Siarto</last_name> <titles> <title>Partner</title> <title>Analyst</title> <title>Designer</title> </titles> <online> <website>http://siarto.com</website> <twitter>@jsiarto</twitter> <github>http://github.com/jsiarto</github> </online>
  • 7. REST ★ Representational State Transfer ★ The web is built to utilize REST ★ Stateless ★ HTTP verbs: GET, POST, PUT, DELETE
  • 8. RESTful Web Services ★ Representational State Transfer ★ The web is built to utilize REST ★ Stateless ★ HTTP verbs: GET, POST, PUT, DELETE
  • 9. APIs make the social web work
  • 11. Telescreen ★ Rails 2.3.8 ★ Basic mashup using RapLeaf, Twitter, Gravatar and Google Maps ★ Search proletarians (users) by email
  • 12.
  • 14. # environment.rb config.gem “rapleaf_api” # controller rapleaf = RapleafApi::Api.new(‘API_KEY’) # find a person @person = rapleaf.query(:type => :person, :opts => {:email => ‘steve@apple.com’}) # view @person.location # Chicago, Illinois, United States
  • 15. RapLeaf Data ★ Basics: name, age, gender, location, occupations, schools, earliest/latest activity, friend count ★ Site Memberships: bebo, facebook, flickr, friendster, hi5, linkedin, livejournal, multiply, myspace, myyearbook, plaxo, twitter
  • 16.
  • 18. # top of controller require ‘md5’ # controller method # MD5 hash the user email address email_hash = MD5.new(params[:prole]) # build a gravatar URI @gravatar = "http://www.gravatar.com/avatar/# {email_hash}?s=150" # view image_tag @gravatar
  • 19.
  • 21. # build a google maps URI image_tag("http://maps.google.com/maps/api/staticmap? center=#{url_for(@person.location)} &zoom=12&size=256x256&maptype=roadmap&sensor=false")
  • 22. # URI base http://maps.google.com/maps/api/ # map position and location staticmap?center=#{url_for(@person.location)} # zoom and size &zoom=12&size=256x256 # map type and sensor &maptype=roadmap&sensor=false
  • 23.
  • 25. # top of controller require 'net/http' require 'uri' # Parse Twitter username from RapLeaf twitter_handle = @person.memberships(:primary)[12] ["profile_url"].gsub("http://twitter.com/", "") unless twitter_handle.nil? # Construct URI uri = URI.parse("http://twitter.com/status/ user_timeline/#{twitter_handle}.json?count=3") # Get JSON @twitter = Net::HTTP.get_response(uri) # Make JSON a Ruby object @tweets = ActiveSupport::JSON.decode(@twitter.body)
  • 26. # view @tweets[0]['user']["description"] # loop through tweets with .each <% @tweets.each do |t| %> <li> <%= t['text'] %><br /><span class="status-url">< %= link_to(t['created_at'], "http://twitter.com/#{t ['user']['screen_name']}/status/#{t['id']}") %></a> </li> <% end %>
  • 28.
  • 29.