The orkut Share API allows website owners to enable their visitors to share the website content with visitor's orkut friends. Users can optionally promote the content among their friends.
The API aims to provide users with a uniform experience while managing their credentials in a secure manner to ensure that their privacy is not compromised. It allows website owners to enable sharing of content on their webpages using Javascript and HTTP GET Interfaces, as described below. All API calls trigger a similar experience for the user, but allow the site to customize the way the sharing is enabled.
Web publishers can post the share buttons in one or more locations on the page using a simple Javascript library. As an example, the following code snippet
<html>
<head>
<title>Google Internet Bus</title>
</head>
<body>
<h1>Google Internet Bus</h1>
<div id="orkut-button"></div>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('orkut.share', '1');
google.setOnLoadCallback(function() {
new google.orkut.share.Button({
lang: 'en',
style: google.orkut.share.Button.STYLE_REGULAR,
title: 'Google Internet Bus',
summary: ('The Internet Bus Project is an attempt ' +
'to educate people about the Internet'),
thumbnail: ('http://lh5.ggpht.com/_AS18ZY6z1m8/SYWgcvA5beI' +
'/AAAAAAAAANw/DfoApipJxcY/s128/DSC_0013%20.jpg'),
destination: 'http://www.google.co.in/en/internetbus/'
}).draw('orkut-button');
});
</script>
</body>
</html>
renders the share button on the webpage as

When users click this button they are prompted to login to orkut if they are not already logged in. They are then shown a preview of the content that will be posted to orkut with an option to also promote what they are sharing. Once the user confirms, the content will be shared with their orkut friends.

The shared content appears in the 'Updates from my friends' section on orkut. If the user had checked 'Promote to your friends,' it also appears in the upper right hand corner of the orkut friends' home and profile pages, alternating with formal advertisements.


| Regular | Mini |
|---|---|
|
|
Webpages can add the buttons shown above anywhere using a JavaScript library, clicking which brings up the share dialog with the item selected for sharing. This API describes the details of the content that can be configured.
<script src="http://www.google.com/jsapi"></script>
| Static field | Description |
|---|---|
STYLE_MINI |
String STYLE_MINI — constant to select the mini button
style.
|
STYLE_REGULAR |
String STYLE_REGULAR — constant to select the regular
button style.
|
| Constructor | Description |
|---|---|
google.orkut.share.Button(options)
|
Map<String, String> options — object containing
optional customizations. The supported options are:
|
| Constructor | Description |
|---|---|
draw(element)
|
Renders the sharing button into the specified (div) element.
String|Element div_element — div element, or id of
div element into which the button should be drawn.
|
| Code | Language |
|---|---|
| en | English (default if detection fails) |
| es | Spanish |
| fr | French |
| pt_BR | Portuguese (Brazil) |
| de | German |
<html>
<head>
<title>An interesting Page</title>
</head>
<body>
<h1>Hello World</h1>
<div id="orkut-button"></div>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('orkut.share', '1');
google.setOnLoadCallback(function() {
new google.orkut.share.Button({
summary: 'So much to see here.'
}).draw('orkut-button');
});
</script>
</body>
</html>
An alternate Javascript API that allows a more direct interaction with the server from the browser and supports more flexible integration with the page with a greater control over the details of the shared item contents. This allows developers to hook the sharing trigger to custom UI elements and user actions.
<script src="http://www.google.com/jsapi"></script>
Instances of this class are used as keys in the sharing configuration dictionary. There is no need to instantiate an object of this class. Available configuration fields are present as static members of this class, and possibly other classes.
| Static field | Description |
|---|---|
NETWORK |
Always 'orkut.com' (reserved for future use). |
CONTENT |
Body of the shared item, a summary of the activity being shared. |
TITLE |
Title of the shared item. |
THUMBNAIL |
Thumbnail image to be included in shared item. |
USER_COMMENT |
Comment by the user on the shared item. |
DESTINATION_URL |
Destination url for the link in the shared item. |
| Constructor | Description |
|---|---|
google.orkut.share.Connection(config, opt_document) |
|
| Method | Description |
|---|---|
send(dest, overrides, opt_callback) |
|
The config and overrides parameters passed to the
constructor and send method of google.orkut.share.Connection are
dictionaries containing settings for the shared item. Setting passed to send
override settings passed to the constructor. The keys of this dictionary are
instances of the google.orkut.share.Field and the values are raw
strings with constraints as specified in the documentation for the
corresponding google.orkut.share.Field instance.
<html>
<head>
<title>An interesting Page</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('orkut.share', '1');
google.setOnLoadCallback(function() {
var params = {};
params[google.orkut.share.Field.TITLE] = 'Interesting Page!';
params[google.orkut.share.Field.DESTINATION_URL] = 'http://example.com/interesting.html';
var connection = new google.orkut.share.Connection(params);
document.getElementById('orkut-share').onclick =
function(e) { connection.send('orkut.com', {}); };
}, true);
</script>
</head>
<body>
<h1>Hello World</h1>
<span id="orkut-share" style="cursor:pointer; border:1px solid black">
Share on Orkut
</span>
</body>
</html>
The web developer can submit a GET request using a form and the sharing service will use the target window to complete the sharing flow. At the end of the flow the it will close the target window. An additional consideration is that the authentication for sharing is based on OAuth. So it is required that the target window display the location bar.
HTTP GET request in the example would look as follows:
http://promote.orkut.com/preview?nt=orkut.com&tt=Something%20Interesting&du=http://example.com&cn=An%20interesting%20page%20to%20visit
<script src="http://promote.orkut.com/preview"></script>
| nt | Must be set to "orkut.com". Reserved for future use. | Required |
| du | URL of content being shared. | Required |
| tt | Title of the shared item, should be plain text. | Required |
| cn | Content to be shared. | Optional |
| uc | User comment on shared item. | Optional |
| tn | A thumbnail image to be included in the shared item. | Optional |
Note: All parameter values must be URL encoded. In the future the set of required fields may change.
<html>
<head>
<title>An interesting Page</title>
</head>
<body>
<h1>Hello World</h1>
<form method="GET" target="_blank" action="http://promote.orkut.com/preview">
<input type="hidden" name="nt" value="orkut.com"/>
<input type="hidden" name="tt" value="Something interesting"/>
<input type="hidden" name="du" value="http://example.com/"/>
<input type="hidden" name="cn" value="An interesting page to visit."/>
<input type="submit" name="share" value="Share"/>
</form>
</body>
</html>
How much does it cost to use?
This feature is 100% free to both publishers and orkut users.
Can users edit or delete the content, once they have shared it?
Yes. This content will appear in the 'My updates' section, which users can delete anytime. If the content is promoted, they can pause or delete it from the 'My promotions' section.
Are users and friends guaranteed to see the shared content from my site?
Users can share content with their friends. However, some of those friends may not see the shared content because there are limits on the activities that show up by default and the number of promotions that can be sent.
How do I get statistics of how many users shared out of my site?
At this time there are no analytics and reports offered to website publishers for this feature. You can look at URL params from your own weblogs to see the level of shared activity.