You are on page 1of 127

The New Social Web:

It’s about Open Standards


Hello

Timothy Jordan
Developer Advocate, Google

buzz.timothyjordan.com
@timothyjordan
#devfest
Agenda

• Open Standards
• Google Buzz
• Examples
• Questions and Answers
Open Standards
...are a really good thing
Why?
Open Source
Open Source
Open Source
Open Source
Open Source
• Freedom
Open Source
• Freedom
• Community
Open Standards
Open Standards
• Simplify
Open Standards
• Simplify
• Interoperability
OAuth

Your Service
Application Get unauthorized Provider
request token

1. Your application gets an unauthorized request


token from the Service Provider’s authorization
server.
OAuth

Your Service
Application Provider
Send user to SP
with token

2. Your application sends the user to the Service


Provider, which asks the user to grant your
application access to the required data.
OAuth

Your Service
Application Get authorized Provider
request token

3. Your application gets an authorized request token


from the authorization server.
OAuth

Your Service
Application Exchange request Provider
for access token

4. You exchange the authorized request token for an


access token.
OAuth

Your Service
Application Use access token Provider
to get data

5. You use the access token to request data from


Service Provider’s service access servers.
Atom
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?>
<?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
feedburner/ext/1.0" gd:etag="W/&quot;CkUGRHk8fyp7ImA9Wx5WEU0.&quot;">
<id>tag:blogger.com,1999:blog-3188762512334365442</id>
<updated>2010-09-21T13:17:05.777-07:00</updated>
<title>Social Web Blog</title>
<subtitle type="html" />
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://googleso
<link rel="alternate" type="text/html" href="http://googlesocialweb.blogspot.com/" />
<link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/3188762512334365
<author>
<name>A Googler</name>
<email>noreply@blogger.com</email>
</author>
<generator version="7.00" uri="http://www.blogger.com">Blogger</generator>
<openSearch:totalResults>45</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" h
<feedburner:info uri="socialwebblog" />
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.app
<entry gd:etag="W/&quot;D0YASX89cCp7ImA9WxFaFUo.&quot;">
<id>tag:blogger.com,1999:blog-3188762512334365442.post-8190772326434476744</id>
<published>2010-07-19T14:14:00.001-07:00</published>
Atom
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>tag:blogger.com,1999:blog-3188762512334365442</id>
<updated>2010-09-21T13:17:05.777-07:00</updated>
<title>Social Web Blog</title>
<author>
<name>A Googler</name>
<email>noreply@blogger.com</email>
</author>
<generator version="7.00" uri="http://www.blogger.com">Blogger</generator>
<link rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/SocialWebBlog" />
<entry>
<id>tag:blogger.com,1999:blog-3188762512334365442.post-8190772326434476744</id>
<published>2010-07-19T14:14:00.001-07:00</published>
<updated>2010-07-19T14:32:28.168-07:00</updated>
<title>Announcing New Google Buzz API features</title>
<content type="html"> ... </content>
<link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3188762512334365
<author>
<name>Timothy Jordan</name>
<uri>http://www.blogger.com/profile/14618592793335366108</uri>
<email>noreply@blogger.com</email>
<gd:extendedProperty name="OpenSocialUserId" value="14459911890912057787" />
</author>
<thr:total>7</thr:total>
<feedburner:origLink>http://googlesocialweb.blogspot.com/2010/07/announcing-new-google-buzz-api
Atom
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>tag:blogger.com,1999:blog-3188762512334365442</id>
<updated>2010-09-21T13:17:05.777-07:00</updated>
<title>Social Web Blog</title>
<author>
<name>A Googler</name>
<email>noreply@blogger.com</email>
</author>
<generator version="7.00" uri="http://www.blogger.com">Blogger</generator>
<link rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/SocialWebBlog" />
<entry>
<id>tag:blogger.com,1999:blog-3188762512334365442.post-8190772326434476744</id>
<published>2010-07-19T14:14:00.001-07:00</published>
<updated>2010-07-19T14:32:28.168-07:00</updated>
<title>Announcing New Google Buzz API features</title>
<content type="html"> ... </content>
<link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3188762512334365
<author>
<name>Timothy Jordan</name>
<uri>http://www.blogger.com/profile/14618592793335366108</uri>
<email>noreply@blogger.com</email>
<gd:extendedProperty name="OpenSocialUserId" value="14459911890912057787" />
</author>
<thr:total>7</thr:total>
Atom
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>tag:blogger.com,1999:blog-3188762512334365442</id>
<updated>2010-09-21T13:17:05.777-07:00</updated>
<title>Social Web Blog</title>
<author>
<name>A Googler</name>
<email>noreply@blogger.com</email>
</author>
<generator version="7.00" uri="http://www.blogger.com">Blogger</generator>
<link rel="self" type="application/atom+xml"
href="http://feeds.feedburner.com/SocialWebBlog" />
<entry>
<id>tag:blogger.com,1999:blog-3188762512334365442.post-8190772326434476744</id>
<published>2010-07-19T14:14:00.001-07:00</published>
<updated>2010-07-19T14:32:28.168-07:00</updated>
<title>Announcing New Google Buzz API features</title>
<content type="html"> ... </content>
<link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3188762512334365
<author>
<name>Timothy Jordan</name>
<uri>http://www.blogger.com/profile/14618592793335366108</uri>
<email>noreply@blogger.com</email>
<gd:extendedProperty name="OpenSocialUserId" value="14459911890912057787" />
code.google.com/p/pubsubhubbub
PubSubHubbub

Publisher Hub Subscriber


PubSubHubbub

Give
me your latest
content for feed
X, please.

Publisher Subscriber

1. Subscriber gets Publisher’s feed. The feed


contains a link to the Hub.
PubSubHubbub

I've delegated
distribution of that
content to this Hub.

Publisher Subscriber

1. Subscriber gets Publisher’s feed. The feed


contains a link to the Hub.
PubSubHubbub

I want to
subscribe to feed
X. Send updates to
this URL

Publisher Hub Subscriber

2. Subscriber POSTs subscription request to the Hub.


The request contains the URL where the Hub
should POST new updates to the Subscriber.
PubSubHubbub

Hey there! Did


you really send this
request?

Publisher Hub Subscriber

3. Hub hits the URL to verify the request was


authentic; Subscriber responds with confirmation to
the Hub.
PubSubHubbub

Yup, that was


really me, not a DoS
attacker.

Publisher Hub Subscriber

3. Hub hits the URL to verify the request was


authentic; Subscriber responds with confirmation to
the Hub.
PubSubHubbub

I have new
content for feed
X for you!

Publisher Hub Subscriber

4. a) Publisher notifies Hub about updates by


POSTing feed URLs to the Hub; Hub pulls the feed
again to find new entries.
PubSubHubbub

Give me
your latest
content for feed
X, please.

Publisher Hub Subscriber

4. a) Publisher notifies Hub about updates by


POSTing feed URLs to the Hub; Hub pulls the feed
again to find new entries.
PubSubHubbub

Here you go.

Publisher Hub Subscriber

4. a) Publisher notifies Hub about updates by


POSTing feed URLs to the Hub; Hub pulls the feed
again to find new entries.
PubSubHubbub

Give me
your latest
content for feed
X, please.

Publisher Hub Subscriber

4. b) If the Publisher does not inform the Hub, the


Hub will periodically poll the Publisher’s feed for
new updates.
PubSubHubbub

Here you go.

Publisher Hub Subscriber

4. b) If the Publisher does not inform the Hub, the


Hub will periodically poll the Publisher’s feed for
new updates.
PubSubHubbub

New update
to feed X! Here
you go.

Publisher Hub Subscriber

5. When Hub receives new update to feed X, it


POSTs the update to the Subscriber’s endpoint
URL.
PubSubHubbub

New update
to feed X! Here
you go.

Publisher Hub Subscriber


Subscriber
Subscriber
Subscriber
Subscriber
Subscriber

6. If feed X has multiple subscribers, the Hub sends


updates to all of them. This reduces load on the
Publisher.
PubSubHubbub
code.google.com/p/pubsubhubbub
salmon-protocol.org
Salmon

I have a
new entry

Source Aggregator
PubSubHubbub

1. New entry is posted on Source, pushed to


subscribers via mechanisms such as
PubSubHubbub, and re-published by an
Aggregator.
Salmon

A new entry? I
will re-publish it
right away.

Source Aggregator
PubSubHubbub

1. New entry is posted on Source, pushed to


subscribers via mechanisms such as
PubSubHubbub, and re-published by an
Aggregator.
Salmon

I have a new
comment on that entry
from you!

Source Aggregator
Salmon

2. New comment is posted on the Aggregator. It


pushes the comment back upstream to the Source
using Salmon
Salmon

A new comment? I
will publish it in the
thread right away [*].

Source Aggregator
Salmon

[*] After using magic security pixie dust to verify provenance.

2. New comment is posted on the Aggregator. It


pushes the comment back upstream to the Source
using Salmon
Salmon

I have a new
comment.

Aggregator
Aggregator
Source Aggregator
Aggregator
PubSubHubbub Aggregator
Aggregator
Aggregator

3. The Source pushes the comment to all subscribers.


Salmon

Thanks, we'll
re-publish this right
away.

Aggregator
Aggregator
Source Aggregator
Aggregator
PubSubHubbub Aggregator
Aggregator
Aggregator

3. The Source pushes the comment to all subscribers.


salmon-protocol.org
activitystrea.ms
Activity Streams

Actor
Activity Streams

Actor

Verb
Activity Streams

Actor

Verb

Object
Activity Streams

Timothy

Posts

A Note
Activity Streams

Barack Obama

Started Following

Timothy Jordan
Activity Streams

Timothy Jordan

Started Following

Barack Obama
Activity Streams

Timothy Jordan

Has Tea With

Bella Swan
Activity Streams

Timothy Jordan

Has Tea With

Bella Swan
activitystrea.ms
Google Buzz API
Warning!
Activity Streams
Actor

Verb

Object
Timothy

Posts

A Note
     "href": "https://www.googleapis.com/buzz/v1/activities/110242419133439594545/@self/tag:google.com,
2010:buzz:z13ispojgwqsinyij04chlupum2ytbspsa4?alt\u003djson",
     "type": "json"
    }
   ],
   "replies": [
    {
     "href": "{url}/{userId}/@self/{commentId}/@comments?alt=json",
     "type": "application/json",
     "count": 2,
     "updated": "2010-05-09T02:53:13.730Z"
    }
   ]
  },
  "actor": {
   "id": "{id}",
   "name": "Timothy Jordan",
   "profileUrl": "{url}/captaintimothy",
   "thumbnailUrl": "{url}/captaintimothy/thumb.jpg"
  },
  "verbs": [
   "post"
  ],
  "object": {
   "type": "note",
   "content": "content goes here",
   "links": {
    "alternate": [
     {
      "href": "http://www.google.com/buzz/a/google.com",
      "type": "text/html"
     }
    ]
   }
  },
    }
   ],
   "replies": [
    {
     "href": "{url}/{userId}/@self/{commentId}/@comments?alt=json",
     "type": "application/json",
     "count": 2,
     "updated": "2010-05-09T02:53:13.730Z"
    }
   ]
  },
  "actor": {
   "id": "{id}",
   "name": "Timothy Jordan",
   "profileUrl": "{url}/captaintimothy",
   "thumbnailUrl": "{url}/captaintimothy/thumb.jpg"
  },
  "verbs": [
   "post"
  ],
  "object": {
   "type": "note",
   "content": "content goes here",
   "links": {
    "alternate": [
     {
      "href": "http://www.google.com/buzz/a/google.com",
      "type": "text/html"
     }
    ]
   }
  },
  "source": {
   "title": "Buzz"
  },
  "visibility": {
   "entries": [
     "type": "json"
    }
   ],
   "replies": [
    {
     "href": "{url}/{userId}/@self/{commentId}/@comments?alt=json",
     "type": "application/json",
     "count": 2,
     "updated": "2010-05-09T02:53:13.730Z"
    }
   ]
  },
  "actor": {
   "id": "{id}",
   "name": "Timothy Jordan",
   "profileUrl": "{url}/captaintimothy",
   "thumbnailUrl": "{url}/captaintimothy/thumb.jpg"
  },
  "verbs": [
   "post"
  ],

  "object": {
   "type": "note",
   "content": "content goes here"
   }
  },
  "source": {
   "title": "Buzz"
  },
  "visibility": {
   "entries": [
    {
     "id": "https://www.googleapis.com/buzz/v1/people/@me/@groups/@public?alt\u003djson",
     "title": "Public"
    }
   ]
  }
 }
{
  "kind": "buzz#activity",
  "title": "note to self",
  "published": "2010-05-09T02:53:13.000Z",
  "updated": "2010-05-09T02:53:13.730Z",
   "id": "tag:google.com,2010:buzz:foo",
  "links": {
   "liked": [
    {
     "href": "https://www.googleapis.com/buzz/v1/activities/110242419133439594545/@self/tag:google.com,
2010:buzz:z13ispojgwqsinyij04chlupum2ytbspsa4/@liked?alt\u003djson",
     "type": "application/json",
     "count": 0
    }
   ],
   "alternate": [
    {
     "href": "http://www.google.com/buzz/a/google.com",
     "type": "text/html"
    }
   ],
   "self": [
    {
     "href": "https://www.googleapis.com/buzz/v1/activities/110242419133439594545/@self/tag:google.com,
2010:buzz:z13ispojgwqsinyij04chlupum2ytbspsa4?alt\u003djson",
{
  "kind": "buzz#activity",
  "title": "note to self",
  "published": "2010-05-09T02:53:13.000Z",
  "updated": "2010-05-09T02:53:13.730Z",
   "id": "tag:google.com,2010:buzz:foo",
  "links": {
   "liked": [
    {
     "href": "{url}/{userid}/@self/{commentId}/@liked?alt=json",
     "type": "application/json",
     "count": 4,
"updated": "2010-05-09T02:53:13.730Z"
    }
   ],
   "alternate": [
    {
     "href": "http://www.google.com/buzz/a/google.com",
     "type": "text/html"
    }
   ],
   "self": [
    {
     "href": "https://www.googleapis.com/buzz/v1/activities/110242419133439594545/@self/tag:google.com,
2010:buzz:z13ispojgwqsinyij04chlupum2ytbspsa4?alt\u003djson",
     "type": "json"
   ],
   "alternate": [
    {
     "href": "http://www.google.com/buzz/a/google.com",
     "type": "text/html"
    }
   ],
   "self": [
    {
     "href": "https://www.googleapis.com/buzz/v1/activities/110242419133439594545/@self/tag:google.com,
2010:buzz:z13ispojgwqsinyij04chlupum2ytbspsa4?alt\u003djson",
     "type": "json"
    }
   ],
"replies": [
   
    {
     "href": "{url}/{userId}/@self/{commentId}/@comments?alt=json",
     "type": "application/json",
     "count": 2,
     "updated": "2010-05-09T02:53:13.730Z"
    }
   ]
  },
  "actor": {
   "id": "110242419133439594545",
   "name": "Timothy Jordan",
   "profileUrl": "{url}/captaintimothy",
   "thumbnailUrl": "{url}/captaintimothy/thumb.jpg"
  },
  "verbs": [
   "post"
  ],
  "object": {
   "profileUrl": "{url}/chabotc",
   "thumbnailUrl": "{url}/chabotc/thumb.jpg"
  },
  "verbs": [
   "post"
  ],
  "object": {
   "type": "note",
   "content": "content goes here",
   "links": {
    "alternate": [
     {
      "href": "http://www.google.com/buzz/a/google.com",
      "type": "text/html"
     }
    ]
   }
  },
  "source": {
   "title": "Buzz"
  },
  "visibility": {
   "entries": [
    {
     "id": "https://www.googleapis.com/buzz/v1/people/@me/@groups/@public?alt\u003djson",
     "title": "Public"
    }
   ]
  }
 }
   "profileUrl": "{url}/chabotc",
   "thumbnailUrl": "{url}/chabotc/thumb.jpg"
  },
  "verbs": [
   "post"
  ],
  "object": {
   "type": "note",
   "content": "content goes here",
   "links": {
    "alternate": [
     {
      "href": "http://www.google.com/buzz/a/google.com",
      "type": "text/html"
     }
    ]
   }
  },
  "source": {
   "title": "Buzz"
  },

"visibility": {
  

   "entries": [
    {
     "id": "{url}/people/@me/@groups/@public?alt=json",
     "title": "Public"
    }
   ]
  }
 }
   "content": "content goes here",
   "links": {
    "alternate": [
     {
      "href": "http://www.google.com/buzz/a/google.com",
      "type": "text/html"
     }
    ]
   }
  },
  "source": {
   "title": "Buzz"
  },
  "visibility": {
   "entries": [
    {
     "id": "{url}/people/@me/@groups/@public?alt=json",
     "title": "Public"
    }
   ]
},

"geocode": "37.783471 -122.39922",


"address": "701-737 Folsom St, San Francisco, CA 94103, USA",
"placeName": "300 3rd St, San Francisco, CA 94107"
}
 }
    "object": {
     "type": "note",
     "content": "content goes here",
"attachments": [
{
"type": "article",
"title": "Name of the link",
"links": {
"alternate": [
{
"href": "{url}/to/article.html",
"type": "text/html"
}
]
}
}
]
    }
    "object": {
     "type": "note",
     "content": "content goes here",
"attachments": [
     
      {
       "type": "photo",
       "links": {
        "preview": [
         {
          "href": "{url}/image_thumb.jpg",
          "type": "image/jpeg"
         }
        ],
        "enclosure": [
         {
          "href": "{url}/image.jpg",
          "type": "image/jpeg",
          "height": 190,
          "width": 260
         }
        ]
       }
      }
     ]
    }
    "object": {
     "type": "note",
     "content": "content goes here",
"attachments": [
{
"type": "video",
"title": "video description goes here",
"links": {
"alternate": [
{
"href": "http://www.youtube.com/watch?v=abcdef",
"type": "text/html"
}
],
"preview": [
{
"href": "{url}/default.jpg",
"type": "image/jpeg"
},
{
"href": "{url}/proxy?thumbnail_default.jpg",
"type": "image/jpeg"
}
]
}
Verbs Objects
Favorite Article Photo
Follow Audio Photo Album
Friend Bookmark Place
Join Comment Playlist
Play File Product
Post Folder Review
Save Group Service
Share List Status
Tag Note Video
Update Person
Verbs Objects
Favorite Article Photo
Follow Audio Photo Album
Friend Bookmark Place
Join Comment Playlist
Play File Product
Post Folder Review
Save Group Service
Share List Status
Tag Note Video
Update Person
Activity Streams
Auth url: https://www.google.com/buzz/api/auth/OAuthAuthorizeToken
https://www.google.com/buzz/api/auth/OAuthAuthorizeToken
scope: https://www.googleapis.com/auth/buzz
?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fbuzz
domain: www.example.org
&domain=www.example.org
&oauth_token=
iconUrl: http://www.example.org/icon.png
PubSubHubbub
Firehose
Photo credit: Nandhp, used under the Creative Commons Attribution-Share Alike 3.0 Unported license.

Gardenhose
Track
Examples
buzz-bingo.appspot.com
Sign-In & Auth for Buzz

client = buzz.Client()
client.build_oauth_consumer(
  OAUTH_CONSUMER_KEY,
  OAUTH_CONSUMER_SECRET
)
client.oauth_scopes.append(
  buzz.FULL_ACCESS_SCOPE
)
Sign-In & Auth for Buzz

request_token = \
  client.fetch_oauth_request_token(
    'http://example.com/oauth/callback/'
  )
# Save request token to the data store
authorization_url = \
  client.build_oauth_authorization_url(
    request_token
  )
Sign-In & Auth for Buzz

# User visits the authorization_url


Sign-In & Auth for Buzz

verifier = request.get('oauth_verifier')
# Lookup request_token in data store
client.oauth_request_token = request_token
access_token = \
  client.fetch_oauth_access_token(verifier)
# Save access token to the data store
Buzz Bingo is open source!
code.google.com/p/buzz-bingo
buzz-bingo.appspot.com
Track
Extras
Let’s Talk: Questions and Answers

Timothy Jordan
Developer Advocate, Google

buzz.timothyjordan.com
@timothyjordan

#devfest

Codelab
Time: 13:20 - 15:00
Location: Track B - 301
Links

https://code.google.com/apis/buzz/docs/

http://code.google.com/p/oacurl/
http://code.google.com/p/buzz-php-client/
http://code.google.com/p/buzz-python-client/
http://code.google.com/p/buzz-java-client/

code.google.com/p/buzz-codelabs
code.google.com/p/buzz-mood

You might also like