SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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 ...
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Kürzlich hochgeladen (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

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.