Presentation is loading. Please wait.

Presentation is loading. Please wait.

Syndication For Search Engines

Similar presentations


Presentation on theme: "Syndication For Search Engines"— Presentation transcript:

1 Syndication For Search Engines
Presented By: Nageswari Vallabhaneni Sukumar Manduva

2 Google Data GData provides a simple standard Protocol for reading and writing data on web. Atom or RSS Atom Publishing Protocol HTTP GET request HTTP PUT request. Results as an Atom or RSS feed

3 Feed Provides frequently updated content.
Syndication of a web feed allows users to subscribe to it. A web feed is also called syndicated feed.

4 Google Data API Authentication Protocol Basics
Common Elements: "Kinds" Batch Processing Google Base API You Tube API

5 Authentication Client app will act on behalf of a particular user of a Google service. Access to account specific information Request Contains Headers for (X-GData-Key, Authorization). X-GData-Key  Developer Key Authorization  ClientLogin (or) AuthSub

6 Authentication Client app will act on behalf of a particular user of a Google service. GData uses two different authentication systems … 1. "ClientLogin" system 2. "AuthSub" system

7 ClientLogin Authentication
ClientLogin Method is used for stand alone applications. Users username, password and the application are encoded in the Authentication request. After a successful authentication request, use the Auth value to create an Authorization header for each GData request: Authorization:GoogleLoginauth=yourAuthValue

8 ClientLogin Authentication

9 ClientLogin Authentication
If a ClientLogin-authenticated GData request fails, you may receive any of a variety of HTTP error status codes in response 403 Account disabled 403 Account deleted 401 Token disabled 401 Token expired

10 AuthSub Authentication
When an API Request is made the Developer Key Header Specifies on behalf of Which registered developer the request is coming.

11 AuthSub Authentication
"AuthSub" system Used if your client is a multi-user web application client To acquire an AuthSub token your web app must redirect the user to the AuthSubRequest URL at Google which has “NEXT” query parameter. Gets an authentication token without ever handling the user's account login information

12 AuthSub Authentication
After you've acquired an authentication token, you use that token to create an Authorization header for each request: Authorization: AuthSub token="yourAuthToken"

13 AuthSub Authentication
If an AuthSub-authenticated GData request fails, you may receive any of a variety of HTTP error status codes in response 401 Token invalid 401 Token disabled 401 Token expired 401 Token revoked

14 AuthSub Authentication
Header for 401 Token Revoked Error 401 Token revoked WWW-Authenticate: AuthSub realm=" Content-Type: text/html; charset=UTF-8 Expires: Wed, 26 Mar :11:31 GMT Cache-Control: private, max-age=0 Content-Length: 149 Date: Wed, 26 Mar :11:31 GMT Server: GFE/1.3

15 Protocol Basics Requesting a feed or other resource:
Assume there's a feed called /Newsfeed, with no entries in it.... To see it, send the following request to the server: GET /Newsfeed

16 Protocol Basics… The server responds: 200 OK
<?xml version="1.0"?> <feed xmlns=" <title>e-News</title> <updated> T16:25:00-08:00</updated> <id> <author> <name>Jo March</name> </author> <link href="/Newsfeed" rel="self"/> </feed>

17 Protocol Basics… Inserting a new entry: POST /Newsfeed
<?xml version="1.0"?> <entry xmlns=" <author> <name>Paul Harvey</name> </author> <title type="text">HeadLines</title> <content type="text">VT Beat UVa</content> </entry>

18 Protocol Basics… The server responds: 201 CREATED
<?xml version="1.0"?> <entry xmlns=" <id>1</id> <link rel="edit" href=" <updated> T16:26:03-08:00</updated> <author> <name>Paul Harvey</name> </author> <title type="text">HeadLines</title> <content type="text">VT Beat UVa</content> </entry>

19 Protocol Basics… Updating an entry :
To update an existing entry, use PUT, with the entry's edit URI Changing entry's text from (" VT Beat UVa ") to (“VT embarrassed UVa."): PUT /myFeed/1/1/ <?xml version="1.0"?> <entry xmlns=" <id>1</id> <link rel="edit" href=" <updated> T16:28:05-08:00</updated> <author> <name>Paul Harvey</name> </author> <title type="text"> Head Lines </title> <content type="text"> VT embarrassed UVa.</content> </entry>

20 Protocol Basics… The server responds:
200 OK <?xml version="1.0"?> <entry xmlns=" <id>1</id> <link rel="edit" href=" <updated> T16:28:05-08:00</updated> <author> <name>Paul Harvey</name> </author> <title type="text"> Head Lines </title> <content type="text"> VT embarrassed UVa.</content> </entry> Edit URI has changed..It now ends with "/2/" instead of "/1/". The final number in the edit URI is a version number.

21 Protocol Basics… Searching for a string:
To do a full-text search for a particular string , send a GET request with the q parameter. GET /Newsfeed?q=VT

22 Protocol Basics… The server responds with all the entries that match the search string “VT” 200 OK <?xml version="1.0"?> <feed xmlns=" <title>e-News</title> <updated> T16:26:03-08:00</updated> <id> <author> <name>Jo March</name> </author> <link href="/Newsfeed" rel="self"/> <entry> <id>1</id> <link rel="edit" href=" /1/2/"/> <name>Paul Harvey</name> <title type="text"> Head Lines </title> <content type="text"> VT embarrassed UVa </content> </entry> </feed>

23 Protocol Basics… Deleting an entry:
To delete an existing entry, send a DELETE request, using the entry's edit URI DELETE /Newsfeed/1/2/ The server responds: 200 OK

24 Common Elements: "Kinds"
Definiton:The collection of elements that together describe a particular item is called a kind For example, The collection of elements that together describe a contact is called the Contact "kind."

25 Common Elements: "Kinds"
Some of the elements in the ‘kind’ are ordinary Atom or RSS elements; Others are defined by Google in a namespace called the "Google data namespace.“ And are represented ‘gd:’ Ex:<gd:phone number>

26 Common Elements: "Kinds"
When an entry in a Google data API feed uses a given kind An Entry contains an <atom:category> element with Its scheme attribute set to " Its term attribute set to the name of the schema URL followed by the name of the kind Ex: a Contact entry includes the following element: <atom: category scheme=" term="

27 Common Elements: "Kinds"
Example : Contact Kind

28 Batch Processing Batch processing gives you the ability to execute multiple operations in one request, rather than having to submit each operation individually. For example, the following feed includes four operations: <feed> <entry> <batch:operation type="insert"/> ... what to insert ... </entry> <batch:operation type="update"/> ... what to update ... <batch:operation type="delete"/> ... what to delete ... <batch:operation type="query"/> ... what to query ... </feed>

29 Overview Table Feature GData Atom RSS2.0 Syndication Format Y Queries
Updates Optimistic Concurrency Authentication

30 Google Base Data API Overview Feeds Used Authentication Querying

31 Overview The Google Base data API enables developers to :
Query Google Base data to create applications and mashups. Input and manage Google Base items programmatically. Google Base is a place where you can submit all kinds of content for Google to host and to make searchable online

32 Overview… Google Base terminology : Google Base data API services
Data items Attributes Item types Google Base data API services searching for data items discovering metadata inserting, updating, and deleting data items

33 Feeds Used Google Base uses two feeds for data Snippets Feed
Items Feed

34 Feeds Used… Snippets Feed : The URL for the snippets feed is:
The snippets feed is read-only. For the general public and provides a slightly shortened description

35 Feeds Used… Items Feed : The URL for the items feed is:
The items feed is read-write. A private customer-specific feed for customers to insert, update, delete, and query their own data. This feed requires authentication

36 Google Base data API Hiding Attributes
You can control whether attributes are visible by specifying the XML attribute access="private" <g:private_id type="text" access="private"> this is not visible by others </g:private_id>

37 Google Base data API Hiding items
You can use the <app:draft> extension element , to upload an item as a draft. You can see draft items on your own items feed. In order to mark an item as a draft, include the <app:control> element <entry> ... <app:control xmlns:app=' <app:draft>yes</app:draft> </app:control> </entry>

38 Authentication Authenticating users

39 Querying Querying for items
A Google Base query is a specially encoded URL that contains parameter ‘bq’ and uses an HTTP GET method to communicate with the server

40 Querying… Querying for metadata
Each data item in Google Base is an instance of an item type. The item types promoted by Google come with a set of approved attributes

41 YouTube Data API Feeds and Entries Uploading Searching Updating
Deleting Sharing Subscribing

42 Video Feeds and Entries
The result of a video feed retrieval or search will give us an Atom feed that has one <entry> tag for each of the video in the result set. The Atom feed that we get will also have all the details of the individual video’s we got through search. The feed will also contain the total number of results in the list, the index of the first item in the list, the number of items in the list and other metadata about the feed. Understanding video feeds and entries

43 Uploading Videos 1.Direct Uploading: This method first stores the
There are two methods of uploading videos on to You Tube they are: 1.Direct Uploading: This method first stores the files on your server and then on You Tube through an API Request. 2.Browser-based Uploading: This method directly sends the users uploaded files to the You Tube servers

44 Direct Uploading Process flow diagram for Direct Uploading

45 Browser-based Uploading
Process flow diagram for Browser-based Uploading

46 Searching For Videos Searching for standard video feeds:
Standard feeds contain lists of videos that either reflect YouTube user behavior, such as top-rated and most viewed video feeds, or were selected by YouTube staff, such as recently featured and mobile video feeds. To retrieve a standard feed, send an HTTP GET request to the URL associated with that feed.

47 Standard Feeds Name Feed Id Example Top rated top_rated Top favorites
Top favorites top_favorites Most viewed most_viewed Most recent most_recent Most discussed most_discussed Most linked most_linked Most responded most_responded Recently featured recently_featured Videos for mobile phones watch_on_mobile

48 Searching For Videos Searching for a Users Video’s:
Retrieving a particular users videos Searching for Related Video’s:

49 Searching For Videos Parameter Definition
Search requests can include any of the following parameters. Parameter Definition vq The vq parameter specifies a search query term. orderby Parameter that will be used to sort Max-results Maximum number of results in the result set author Video’s uploaded by a specific user alt Specifies the format of the feed to be returned Start-index Specifies the index of the first matching result lr Restricts the search to videos that have a title, description or keywords in a specific language.

50 Searching For Videos Parameter Definition format
The format parameter specifies that videos must be available in a particular video format. racy Allows a search result set to include restricted content as well as standard content. restriction Identifies the IP address that should be used to filter videos that can only be played in specific countries time Restricts the search to videos uploaded within the specified time.

51 Searching Searching for a video with a keyword of abimm
Searching for a video with a keyword of abimm and orderby published date Searching for a video with a keyword of demo and orderby published date and by abimm author

52 Updating a Video Entry To update a video, send an HTTP PUT request to the URL identified in the video entry's <link> tag where the rel attribute value is edit. <link rel='edit' type='application/atom+xml' href=' The body of the PUT request is an Atom XML entry that contains information about the video. excluding an element will delete the information that already exists for that video Updating a video entry

53 Deleting a Video Entry Deleting a Video Entry
To delete a video, send an HTTP DELETE request to the edit URL for that video DELETE /feeds/api/users/USER_ID/uploads/VIDEO_ID HTTP/1.1 Host: gdata.youtube.com Content-Type: application/atom+xml Authorization: AuthSub token=AUTHORIZATION_TOKEN X-GData-Client: CLIENT_ID X-GData-Key: key=DEVELOPER_KEY Deleting a Video Entry

54 Sharing Videos To send a video
1. API request to retrieve information about a video. 2. After watching the video, the user clicks a link to send the video to one or more contacts. 3. Your application submits a request to retrieve the contact list for the currently authenticated user. 4. Your application displays a form that allows the user to select one or more contacts to send the video to. You send an HTTP PUT request to each selected contact.

55 Subscriptions A subscription refers to an entity that notifies a user when new videos are uploaded. Retrieving Subscriptions: To request a feed of a particular user's subscriptions, send an HTTP GET request to the following URL.

56 References http://code.google.com/apis/gdata/


Download ppt "Syndication For Search Engines"

Similar presentations


Ads by Google