24. Application Discovery
Application Directory
Categories, sorting and filtering
Application Homepage
My Friends' applications
Other recommendations
Manage your applications
Viral Channels
Friend Updates
Notifications
Invites
Email (limited to 1 per user per app per day)
27. Friend Updates
On both homepage and profile page
Created using the OpenSocial Activity API (requestCreateActivity)
Publication not guaranteed but typically high (> 80%)
28. Notifications
Sent using the OpenSocial request* API. (requestSendMessage,
type=NOTIFICATION)
Limited to 5 per user per app per day
29. Invites
All apps have built-in invite flow from profile and canvas pages
34. OpenSocial Feature: hi5
An optional feature that provides access to additional hi5-
specific functionality.
New data requests (hi5 feature)
Photos (hi5.fetchAlbumsDataRequest)
Online Presence (hi5.fetchPresenceRequest)
Status (hi5.fetchStatusRequest)
New fields
Link for friend update media (hi5.ActivityMediaItemField.LINK)
Much more to come!
40. More reasons to develop for hi5...
A new audience via our unique footprint in Latin America,
Europe and Asia
Of the more than 80 million individuals registered with
hi5, less than a third are also active on the other leading
social networks, incl. FB, MySpace, Bebo, Friendster
(comscore)
OpenSocial!
Apps can be deeply embedded within hi5, as well as
easily translated beyond hi5 to other OpenSocial-
enabled websites
41. More reasons to develop for hi5...
$$$
A dedicated canvas page that can be monetized
Promotions on the hi5 blog (one developer post/mo –
rotating among our registered developers with popular
apps)
Free Infrastructure from Joyent
hi5 Developers could win one year of Joyent’s Free
Accelerator™ scalable, on-demand infrastructure for
their hi5 app!
Limited number at launch, more to come
42. More reasons to develop for hi5...
Translation Services
We plan on offering translation support into Spanish to
the first 100 high-quality applications approved for
production
We look forward to offering built-in translation support for
all hi5 applications in multiple languages in future
versions of the platform
43. hi5 Platform Launch
Several hundred apps in our sandbox that we are reviewing
and working with developers to finalize.
White-list style approach to ensure app quality and user-
centric relevancy (guidelines to be published this week)
March 31st Public Launch
Public rollout begins! We'll launch with as many applications
that have met our guidelines and are ready to go live.
44. Important Links
Developer site
http://developer.hi5.com - All below links are accessible from here.
Developer Registration
http://sandbox.hi5.com/friend/apps/developer.do
API Documentation
http://api.hi5.com
Application Guidelines
http://www.hi5networks.com/platform/wiki/AppGuidelines
Bug Tracker
http://www.hi5networks.com/platform/report
Discussion Forums
http://www.hi5networks.com/platform/discussion
48. Important Meta-data
<ModulePrefs title=quot;Gifts Tutorial”
author_email=”lrm718@yahoo.com”
summary=quot;short description for list viewsquot;
description=quot;long description for previewquot;
thumbnail=quot;http://yourhost/path_to_120x60_imgquot;
icon=quot;http://yourhost/path_to_15x15_faviconquot;
>
56. Adding App Data
var givenGifts = {};
function giveGift() {
var nut = document.getElementById('nut').value;
var friend = document.getElementById('person').value;
givenGifts[friend] = nut;
var json = gadgets.json.stringify(givenGifts);
var req = opensocial.newDataRequest();
req.add(req.newUpdatePersonAppDataRequest(opensocial.DataRequest.PersonId.VIEWER,
'gifts', json));
req.send();
}
60. Displaying App Data
function updateGiftList(viewer, data, friends) {
var json = data[viewer.getId()]['gifts'];
if (!json) {
givenGifts = {};
}
try {
givenGifts = gadgets.json.parse(json);
} catch (e) {
givenGifts = {};
}
var options = ['a cashew nut', 'a peanut', 'a hazelnut', 'a red pistachio nut'];
var html = new Array();
html.push('You have given:');
html.push('<ul>');
for (i in givenGifts) {
if (+(i) > 0) {
html.push('<li>' + friends[i] + ' received ' + options[givenGifts[i]] + '</li>');
}
}
html.push('</ul>');
document.getElementById('given').innerHTML = html.join('');
}
63. Resizing the Window
In Module element:
<Require feature=quot;dynamic-heightquot;/>
After rendering content:
gadgets.window.adjustHeight()
64. Creating Activity
function createActivity(title) {
var opts = new Array();
opts[opensocial.Activity.Field.TITLE] = title;
var mediaItems = new Array();
var mediaItem = opensocial.newActivityMediaItem(opensocial.Activity.MediaItem.Type.IMAGE, viewer.
getField(opensocial.Person.Field.THUMBNAIL_URL));
// Add a media item link if supported
if(gadgets.util.hasFeature('hi5') && opensocial.getEnvironment().supportsField(opensocial.Environment.
ObjectType.ACTIVITY_MEDIA_ITEM, hi5.ActivityMediaItemField.LINK)) {
mediaItem.setField(hi5.ActivityMediaItemField.LINK, viewer.getField(opensocial.Person.Field.
PROFILE_URL));
}
var activity = opensocial.newActivity(opts);
65. Sending Notifications
function sendNotifications(notification, toIds) {
var params = new Object();
params[opensocial.Message.Field.TYPE] = opensocial.
Message.Type.NOTIFICATION;
var message = opensocial.newMessage(notification, params);
opensocial.requestSendMessage(toIds, message);
}
66. Sending Notifications
var viewerLink = viewer.getField(opensocial.Person.Field.PROFILE_URL);
var notification = '<a href=quot;' + viewerLink + 'quot;>' + viewer.getDisplayName() +
'</a> gave you a ' + options[nut];
var toIds = {};
toIds.push(friend);
sendNotifications(notification, toIds);
67. Making Content Requests
function getJournal() {
gadgets.io.makeRequest('http://api.hi5.com/rest/feed/journal/userId',
function(response) {
var data = response.data;
// do something with data
},
{'METHOD' : 'GET', 'CONTENT_TYPE' : 'DOM'}
);
}
71. Navigating to a View
function navToCanvas() {
var views = gadgets.views.getSupportedViews();
gadgets.views.requestNavigateTo(views['canvas']);
}
72. Using Skins
In ModulePrefs:
<Require feature=quot;skinsquot;/>
In Your Application:
function setSkin() {
document.write('<style type=quot;text/cssquot;>');
document.write('.main {');
bgColor = gadgets.skins.getProperty(gadgets.skins.Property.BG_COLOR);
if(bgColor) {
document.write('background-color:' + bgColor + ';');
}
document.write('}');
document.wrtie('</style>');
}
73. Adding the hi5 OpenSocial API
In ModulePrefs:
<Optional feature='hi5'/>
74. Adding hi5 data requests
var req = opensocial.newDataRequest();
req.add(req.newUpdatePersonAppDataRequest(opensocial.DataRequest.PersonId.VIEWER,'gifts', json));
req.add(req.newFetchPersonRequest('VIEWER'), 'viewer');
req.add(req.newFetchPersonRequest('OWNER'), 'owner');
req.add(req.newFetchPeopleRequest('VIEWER_FRIENDS'), 'viewerFriends');
req.add(req.newFetchPersonAppDataRequest('VIEWER', 'gifts'), 'data');
if(gadgets.util.hasFeature('hi5')) {
req.add(hi5.newFetchStatusRequest('OWNER'),'ownerStatus');
req.add(hi5.newFetchPresenceRequest('VIEWER_FRIENDS'),'viewerFriendsPresence');
}
req.send(onLoadFriends);
Documentation on hi5 js objects:
http://www.hi5networks.com/platform/wiki/JsAPI (Work in progress)
75. hi5 REST API
api.hi5.com
Roadmap
We will add support to access more of our REST API via
OpenSocial calls
We will move towards compliance with a standard
OpenSocial REST API implementation