SlideShare uma empresa Scribd logo
1 de 45
hi5 OpenSocial Codelab
hi5 - Dominant Global Social Network
We are one of the largest web sites in the world (#8 on
  Alexa) and the most global of all the social networking
  sites.
 Over 70+ million registered members and ~40 million
  WW unique users
 Most popular Spanish-speaking social network in the
  world
Top 10 in Latin America
Mexico, Colombia, Bolivia, Guatemala, Peru, Costa Rica,
  Nicaragua, Honduras, Ecuador, El Salvador
Top 10 in Rest of the World
Portugal, Greece, Romania, Cyprus, Thailand, Jamaica, Sri
  Lanka, Kuwait, Jordan, Oman
Hi5’s Demographics
 Broad reach across major demos:

     18 to 34 primary

     Roughly 50%split male/female

     US traffic: significant percentage is Hispanic

 Diverse traffic from Europe (25%), North America (15%) and Central & South
America (31%), Asia (21%)
 Offered in 14 languages

 Grew big in most international countries with English first and then
translated
 Members use the site primarily to keep in touch with their friends. Users
have limited self-expression tools - skins, widgets, etc.
Getting Started
•  A text editor, or the hi5 Gadget Editor
•  Web hosting, or the built-in hosting in the
 hi5 Gadget Editor
• A hi5 account
• Access to the hi5 sandbox
Getting Started on sandbox.hi5.com
Two ways to get
your App going




                  Sample App lets
                     you Edit
Editing Console
Preview Mode
Integration Points

•   Preview Page
•   Profile Module
•   Canvas Page
•   Friend Updates
•   Notifications
•   App Invites
•   Emails
Hello World
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
 <ModulePrefs title="Hello World!” author_email=”lou@hi5.com”>
  <Require feature="opensocial-0.7" />
 </ModulePrefs>
 <Content type="html">
  <![CDATA[
   Hello, world!
  ]]>
 </Content>
</Module>
Hello World
• <Module> indicates that this XML file contains a gadget.
• <ModulePrefs> contains information about the gadget, and
  its author.
• author_email must match your hi5 account’s email in the
  hi5 container
• <Require feature="opensocial-0.7" /> denotes a required
  feature of the gadget — in this case, the OpenSocial API
  (v0.7).
• <Content type="html"> indicates that the gadget's content
  type is HTML.
• <![ CDATA[…]]> contains the bulk of the gadget, including
  all of the HTML, CSS, and JavaScript (or references to such
  files).
Initialization
gadgets.util.registerOnLoadHandler(init);

function init() {
  loadFriends();
}
Fetching Friends
function loadFriends() {
 var req = opensocial.newDataRequest();
 req.add(req.newFetchPersonRequest('VIEWER'),
  'viewer');

  req.add(req.newFetchPeopleRequest('VIEWER_F
  RIENDS'), 'viewerFriends');
req.send(onLoadFriends);
}
Handle the Response
Handle the Response
function onLoadFriends(data) {
 var viewer = data.get('viewer').getData();
 var viewerFriends = data.get('viewerFriends').getData();

    html = new Array();
    html.push('<ul>');
    viewerFriends.each(function(person) {
     html.push('<li>' + person.getDisplayName() + "</li>");
    });
    html.push('</ul>');
    document.getElementById('friends').innerHTML = html.join('');
}
Adding App Data
Adding App Data
Adding App Data
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();
}
Displaying App Data
Displaying App Data
Displaying App Data
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('');
}
Displaying App Data
Displaying App Data
Displaying App Data
Displaying App Data
Displaying App Data
function updateReceivedList(viewer, data, friends) {
 var viewerId = viewer.getId();
 var options = ['a cashew nut', 'a peanut', 'a hazelnut', 'a red pistachio nut'];

    var html = new Array();
    html.push('You have received:<ul>');
    friends.each(function(person) {
     var personData = data[person.getId()];
     if (personData) {
       var json = data[person.getId()]['gifts'];

      var gifts = {}
      if (!json) {
        gifts = {};
      }
      try {
        gifts = gadgets.json.parse(json);
      } catch (e) {
        gifts = {};
      }

      for (i in gifts) {
        if (+(i) > 0 && i == viewerId) {
          html.push('<li>' + options[gifts[i]] + ' from ' + person.getDisplayName() + '</li>');
        }
      }
     }
    });
    html.push('</ul>');
    document.getElementById('recieved').innerHTML = html.join('');
}
Displaying App Data
Resizing the Window
Resizing the Window
Creating Activity
function createActivity(title) {
  var opts = new Array();

    opts[opensocial.Activity.Field.TITLE] = title;
    opts[opensocial.Activity.Field.STREAM_FAVICON_URL] = 'http://images.hi5.com/images/icons/
      _/update_widget.png');

    var activity = opensocial.newActivity(opts);

    // Request the activity creation
    opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH);
}
Creating Activity
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);
}
Sending Notifications
Making Content Requests
Making Content Requests

function getStatus() {
var authToken = this.sandbox.hi5Container.params['Hi5AuthToken'];
  gadgets.io.makeRequest('http://api.hi5.com/rest/status/getStatus?
    userId='+viewer.getField(opensocial.Person.Field.ID) +'&Hi5AuthToken='+authToken,
       function(response) {
          var data = response.data;
          console.debug(response.text);
          var content = data.getElementsByTagName('content');
          if(content.length == 1) {
            document.getElementById('status').innerHTML = "Your status: " +
    content.item(0).firstChild.nodeValue;
          }
       },
  {'METHOD' : 'GET', 'CONTENT_TYPE' : 'DOM'});
}
Working With Views
Working With Views
<Content type=“html” view=“profile”>
<![CDATA[
<script
   src="http://images.hi5.com/images/opensocial/gifts.js"></script>
    <script>
     gadgets.util.registerOnLoadHandler(initProfile);
    </script>
    <div id='main'>
     <div id='received’></div>
    </div>
 ]]>
</Content>
Navigating to a View
Navigating to a View

function navToCanvas() {
     var views = gadgets.views.getSupportedViews();
     gadgets.views.requestNavigateTo(views['canvas']);
}
Applying a Skin
Applying a Skin
Other Features

• requestShareApp
• requestSendMessage
  – EMAIL, PRIVATE_MESSAGE, PUBLIC_MESSAGE
• Person Field extensions
  – SMALL_IMG_URL, MEDIUM_IMG_URL,
    LARGE_IMG_URL
• Lifecycle Callbacks
• Activity Templates
hi5 Roadmap
March 15: Hackathon geared towards launch
 preparation. Apps will be considered for
 whitelisting from this date until launch.

March 31: Production launch

Mais conteúdo relacionado

Mais procurados

jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Treeadamlogic
 
HirshHorn theme: how I created it
HirshHorn theme: how I created itHirshHorn theme: how I created it
HirshHorn theme: how I created itPaul Bearne
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j queryMd. Ziaul Haq
 
Self join in active record association
Self join in active record associationSelf join in active record association
Self join in active record associationRORLAB
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do MoreRemy Sharp
 
Achilles presentation
Achilles presentationAchilles presentation
Achilles presentationDuyhai Doan
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web developmentJohannes Brodwall
 
Introduction to jQuery - The basics
Introduction to jQuery - The basicsIntroduction to jQuery - The basics
Introduction to jQuery - The basicsMaher Hossain
 
Stack Overflow Austin - jQuery for Developers
Stack Overflow Austin - jQuery for DevelopersStack Overflow Austin - jQuery for Developers
Stack Overflow Austin - jQuery for DevelopersJonathan Sharp
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptDarren Mothersele
 
Ajax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsAjax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsTse-Ching Ho
 
Migration to jQuery 3.5.x
Migration to jQuery 3.5.xMigration to jQuery 3.5.x
Migration to jQuery 3.5.xStanislavIdolov
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency InjectionAnton Kril
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web ComponentsFelix Arntz
 

Mais procurados (18)

jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Tree
 
HirshHorn theme: how I created it
HirshHorn theme: how I created itHirshHorn theme: how I created it
HirshHorn theme: how I created it
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
 
Self join in active record association
Self join in active record associationSelf join in active record association
Self join in active record association
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
Achilles presentation
Achilles presentationAchilles presentation
Achilles presentation
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Introduction to jQuery - The basics
Introduction to jQuery - The basicsIntroduction to jQuery - The basics
Introduction to jQuery - The basics
 
jQuery quick tuts
jQuery quick tutsjQuery quick tuts
jQuery quick tuts
 
Stack Overflow Austin - jQuery for Developers
Stack Overflow Austin - jQuery for DevelopersStack Overflow Austin - jQuery for Developers
Stack Overflow Austin - jQuery for Developers
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
 
Ajax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsAjax nested form and ajax upload in rails
Ajax nested form and ajax upload in rails
 
Migration to jQuery 3.5.x
Migration to jQuery 3.5.xMigration to jQuery 3.5.x
Migration to jQuery 3.5.x
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency Injection
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
 
Jquery ui
Jquery uiJquery ui
Jquery ui
 
Bacbkone js
Bacbkone jsBacbkone js
Bacbkone js
 
Jquery 3
Jquery 3Jquery 3
Jquery 3
 

Destaque (6)

Xpi final presentation
Xpi final presentationXpi final presentation
Xpi final presentation
 
Social media lab
Social media labSocial media lab
Social media lab
 
Diapositivas
DiapositivasDiapositivas
Diapositivas
 
페이스북 캐리비안베이
페이스북 캐리비안베이페이스북 캐리비안베이
페이스북 캐리비안베이
 
Practica 1
Practica 1Practica 1
Practica 1
 
Morality of the profit
Morality of the profitMorality of the profit
Morality of the profit
 

Semelhante a Hi5 opensocial-code-lab-presentation-1203814696810018-3

Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon PresentationLou Moore
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegapyangdj
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaveryangdj
 
The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009Chris Chabot
 
The Principle of Hybrid App.
The Principle of Hybrid App.The Principle of Hybrid App.
The Principle of Hybrid App.musart Park
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4Heather Rock
 
Python Code Camp for Professionals 1/4
Python Code Camp for Professionals 1/4Python Code Camp for Professionals 1/4
Python Code Camp for Professionals 1/4DEVCON
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJSEdi Santoso
 
Spiffy Applications With JavaScript
Spiffy Applications With JavaScriptSpiffy Applications With JavaScript
Spiffy Applications With JavaScriptMark Casias
 
Open Social Presentation - GSP West 2008
Open Social Presentation - GSP West 2008Open Social Presentation - GSP West 2008
Open Social Presentation - GSP West 2008Patrick Chanezon
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsJarod Ferguson
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformanceJonas De Smet
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datosphilogb
 

Semelhante a Hi5 opensocial-code-lab-presentation-1203814696810018-3 (20)

Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon Presentation
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
 
Client Web
Client WebClient Web
Client Web
 
The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009
 
The Principle of Hybrid App.
The Principle of Hybrid App.The Principle of Hybrid App.
The Principle of Hybrid App.
 
Opensocial Codelab
Opensocial CodelabOpensocial Codelab
Opensocial Codelab
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
Eu odeio OpenSocial
Eu odeio OpenSocialEu odeio OpenSocial
Eu odeio OpenSocial
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
 
Python Code Camp for Professionals 1/4
Python Code Camp for Professionals 1/4Python Code Camp for Professionals 1/4
Python Code Camp for Professionals 1/4
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJS
 
Spiffy Applications With JavaScript
Spiffy Applications With JavaScriptSpiffy Applications With JavaScript
Spiffy Applications With JavaScript
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
J query training
J query trainingJ query training
J query training
 
Open Social Presentation - GSP West 2008
Open Social Presentation - GSP West 2008Open Social Presentation - GSP West 2008
Open Social Presentation - GSP West 2008
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.js
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datos
 

Último

Model Call Girl in Shastri Nagar Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shastri Nagar Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shastri Nagar Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shastri Nagar Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Majestique Viman Nagar Pune Brochure.pdf
Majestique Viman Nagar Pune Brochure.pdfMajestique Viman Nagar Pune Brochure.pdf
Majestique Viman Nagar Pune Brochure.pdfBabyrudram
 
Premium Villa Projects in Sarjapur Road Bengaluru
Premium Villa Projects in Sarjapur Road BengaluruPremium Villa Projects in Sarjapur Road Bengaluru
Premium Villa Projects in Sarjapur Road BengaluruShivaSeo3
 
Listing Turkey Sylvana Istanbul - Bahcesehir
Listing Turkey Sylvana Istanbul - BahcesehirListing Turkey Sylvana Istanbul - Bahcesehir
Listing Turkey Sylvana Istanbul - BahcesehirListing Turkey
 
2k Shot Call girls Karol Bagh Delhi 9205541914
2k Shot Call girls Karol Bagh Delhi 92055419142k Shot Call girls Karol Bagh Delhi 9205541914
2k Shot Call girls Karol Bagh Delhi 9205541914Delhi Call girls
 
Call Girls in Kashmiri Gate Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Kashmiri Gate Delhi 💯Call Us 🔝8264348440🔝Call Girls in Kashmiri Gate Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Kashmiri Gate Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Magarpatta Nova Elegance Mundhwa Pune E-Brochure.pdf
Magarpatta Nova Elegance Mundhwa Pune  E-Brochure.pdfMagarpatta Nova Elegance Mundhwa Pune  E-Brochure.pdf
Magarpatta Nova Elegance Mundhwa Pune E-Brochure.pdfManishSaxena95
 
9711199012 Call {Girls Delhi} Very Low rate Vaishali DownLoad PDF
9711199012 Call {Girls Delhi} Very Low rate Vaishali DownLoad PDF9711199012 Call {Girls Delhi} Very Low rate Vaishali DownLoad PDF
9711199012 Call {Girls Delhi} Very Low rate Vaishali DownLoad PDFMs Riya
 
Call Girls In Laxmi Nagar Delhi +91-8447779280! !Best Woman Seeking Man Escor...
Call Girls In Laxmi Nagar Delhi +91-8447779280! !Best Woman Seeking Man Escor...Call Girls In Laxmi Nagar Delhi +91-8447779280! !Best Woman Seeking Man Escor...
Call Girls In Laxmi Nagar Delhi +91-8447779280! !Best Woman Seeking Man Escor...asmaqueen5
 
Nanke Area Estate commercial ( Dir. Kat Kuo)
Nanke Area Estate commercial ( Dir. Kat Kuo)Nanke Area Estate commercial ( Dir. Kat Kuo)
Nanke Area Estate commercial ( Dir. Kat Kuo)jessica288382
 
Call Girls In Chand Nagar (Delhi)+918447779280 Welcome To Vip Women Seeking M...
Call Girls In Chand Nagar (Delhi)+918447779280 Welcome To Vip Women Seeking M...Call Girls In Chand Nagar (Delhi)+918447779280 Welcome To Vip Women Seeking M...
Call Girls In Chand Nagar (Delhi)+918447779280 Welcome To Vip Women Seeking M...asmaqueen5
 
FULL ENJOY - 8264348440 Call Girls in DLf Phase 4 | Gurgaon
FULL ENJOY - 8264348440 Call Girls in DLf Phase 4 | GurgaonFULL ENJOY - 8264348440 Call Girls in DLf Phase 4 | Gurgaon
FULL ENJOY - 8264348440 Call Girls in DLf Phase 4 | Gurgaonsoniya singh
 
Puravankara Mundhwa Pune E-Brochure.pdf
Puravankara Mundhwa Pune  E-Brochure.pdfPuravankara Mundhwa Pune  E-Brochure.pdf
Puravankara Mundhwa Pune E-Brochure.pdfManishSaxena95
 
:/Call Girls In Saidulajab Delhi ➥9990211544 High profile Riya Escorts In 24/...
:/Call Girls In Saidulajab Delhi ➥9990211544 High profile Riya Escorts In 24/...:/Call Girls In Saidulajab Delhi ➥9990211544 High profile Riya Escorts In 24/...
:/Call Girls In Saidulajab Delhi ➥9990211544 High profile Riya Escorts In 24/...lizamodels9
 
Call Girls Janta Market {Delhi//8447779280)) ₹↬Short 2000 Full Night 5500 ↫Es...
Call Girls Janta Market {Delhi//8447779280)) ₹↬Short 2000 Full Night 5500 ↫Es...Call Girls Janta Market {Delhi//8447779280)) ₹↬Short 2000 Full Night 5500 ↫Es...
Call Girls Janta Market {Delhi//8447779280)) ₹↬Short 2000 Full Night 5500 ↫Es...asmaqueen5
 
The Omaxe State Dwarka Delhi-broucher.pdf.pdf
The Omaxe State Dwarka Delhi-broucher.pdf.pdfThe Omaxe State Dwarka Delhi-broucher.pdf.pdf
The Omaxe State Dwarka Delhi-broucher.pdf.pdfkratirudram
 
Raquel Thompson: Combining Creativity with Practicality in Architecture
Raquel Thompson: Combining  Creativity with Practicality in ArchitectureRaquel Thompson: Combining  Creativity with Practicality in Architecture
Raquel Thompson: Combining Creativity with Practicality in ArchitectureRaquel Thompson Barbados
 
Call Girls in Noida Sector 12 Noida 💯Call Us 🔝 9582086666 🔝 South Delhi Escor...
Call Girls in Noida Sector 12 Noida 💯Call Us 🔝 9582086666 🔝 South Delhi Escor...Call Girls in Noida Sector 12 Noida 💯Call Us 🔝 9582086666 🔝 South Delhi Escor...
Call Girls in Noida Sector 12 Noida 💯Call Us 🔝 9582086666 🔝 South Delhi Escor...delhimodel235
 
Maha Mauka Squarefeet Brochure |Maha Mauka Squarefeet PDF Brochure|
Maha Mauka Squarefeet Brochure |Maha Mauka Squarefeet PDF Brochure|Maha Mauka Squarefeet Brochure |Maha Mauka Squarefeet PDF Brochure|
Maha Mauka Squarefeet Brochure |Maha Mauka Squarefeet PDF Brochure|AkshayJoshi575980
 
Pooja Mehta 9167673311 Get Warm Welcome By Andheri Escorts For Desired Fantasies
Pooja Mehta 9167673311 Get Warm Welcome By Andheri Escorts For Desired FantasiesPooja Mehta 9167673311 Get Warm Welcome By Andheri Escorts For Desired Fantasies
Pooja Mehta 9167673311 Get Warm Welcome By Andheri Escorts For Desired FantasiesPooja Nehwal
 

Último (20)

Model Call Girl in Shastri Nagar Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shastri Nagar Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shastri Nagar Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shastri Nagar Delhi reach out to us at 🔝8264348440🔝
 
Majestique Viman Nagar Pune Brochure.pdf
Majestique Viman Nagar Pune Brochure.pdfMajestique Viman Nagar Pune Brochure.pdf
Majestique Viman Nagar Pune Brochure.pdf
 
Premium Villa Projects in Sarjapur Road Bengaluru
Premium Villa Projects in Sarjapur Road BengaluruPremium Villa Projects in Sarjapur Road Bengaluru
Premium Villa Projects in Sarjapur Road Bengaluru
 
Listing Turkey Sylvana Istanbul - Bahcesehir
Listing Turkey Sylvana Istanbul - BahcesehirListing Turkey Sylvana Istanbul - Bahcesehir
Listing Turkey Sylvana Istanbul - Bahcesehir
 
2k Shot Call girls Karol Bagh Delhi 9205541914
2k Shot Call girls Karol Bagh Delhi 92055419142k Shot Call girls Karol Bagh Delhi 9205541914
2k Shot Call girls Karol Bagh Delhi 9205541914
 
Call Girls in Kashmiri Gate Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Kashmiri Gate Delhi 💯Call Us 🔝8264348440🔝Call Girls in Kashmiri Gate Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Kashmiri Gate Delhi 💯Call Us 🔝8264348440🔝
 
Magarpatta Nova Elegance Mundhwa Pune E-Brochure.pdf
Magarpatta Nova Elegance Mundhwa Pune  E-Brochure.pdfMagarpatta Nova Elegance Mundhwa Pune  E-Brochure.pdf
Magarpatta Nova Elegance Mundhwa Pune E-Brochure.pdf
 
9711199012 Call {Girls Delhi} Very Low rate Vaishali DownLoad PDF
9711199012 Call {Girls Delhi} Very Low rate Vaishali DownLoad PDF9711199012 Call {Girls Delhi} Very Low rate Vaishali DownLoad PDF
9711199012 Call {Girls Delhi} Very Low rate Vaishali DownLoad PDF
 
Call Girls In Laxmi Nagar Delhi +91-8447779280! !Best Woman Seeking Man Escor...
Call Girls In Laxmi Nagar Delhi +91-8447779280! !Best Woman Seeking Man Escor...Call Girls In Laxmi Nagar Delhi +91-8447779280! !Best Woman Seeking Man Escor...
Call Girls In Laxmi Nagar Delhi +91-8447779280! !Best Woman Seeking Man Escor...
 
Nanke Area Estate commercial ( Dir. Kat Kuo)
Nanke Area Estate commercial ( Dir. Kat Kuo)Nanke Area Estate commercial ( Dir. Kat Kuo)
Nanke Area Estate commercial ( Dir. Kat Kuo)
 
Call Girls In Chand Nagar (Delhi)+918447779280 Welcome To Vip Women Seeking M...
Call Girls In Chand Nagar (Delhi)+918447779280 Welcome To Vip Women Seeking M...Call Girls In Chand Nagar (Delhi)+918447779280 Welcome To Vip Women Seeking M...
Call Girls In Chand Nagar (Delhi)+918447779280 Welcome To Vip Women Seeking M...
 
FULL ENJOY - 8264348440 Call Girls in DLf Phase 4 | Gurgaon
FULL ENJOY - 8264348440 Call Girls in DLf Phase 4 | GurgaonFULL ENJOY - 8264348440 Call Girls in DLf Phase 4 | Gurgaon
FULL ENJOY - 8264348440 Call Girls in DLf Phase 4 | Gurgaon
 
Puravankara Mundhwa Pune E-Brochure.pdf
Puravankara Mundhwa Pune  E-Brochure.pdfPuravankara Mundhwa Pune  E-Brochure.pdf
Puravankara Mundhwa Pune E-Brochure.pdf
 
:/Call Girls In Saidulajab Delhi ➥9990211544 High profile Riya Escorts In 24/...
:/Call Girls In Saidulajab Delhi ➥9990211544 High profile Riya Escorts In 24/...:/Call Girls In Saidulajab Delhi ➥9990211544 High profile Riya Escorts In 24/...
:/Call Girls In Saidulajab Delhi ➥9990211544 High profile Riya Escorts In 24/...
 
Call Girls Janta Market {Delhi//8447779280)) ₹↬Short 2000 Full Night 5500 ↫Es...
Call Girls Janta Market {Delhi//8447779280)) ₹↬Short 2000 Full Night 5500 ↫Es...Call Girls Janta Market {Delhi//8447779280)) ₹↬Short 2000 Full Night 5500 ↫Es...
Call Girls Janta Market {Delhi//8447779280)) ₹↬Short 2000 Full Night 5500 ↫Es...
 
The Omaxe State Dwarka Delhi-broucher.pdf.pdf
The Omaxe State Dwarka Delhi-broucher.pdf.pdfThe Omaxe State Dwarka Delhi-broucher.pdf.pdf
The Omaxe State Dwarka Delhi-broucher.pdf.pdf
 
Raquel Thompson: Combining Creativity with Practicality in Architecture
Raquel Thompson: Combining  Creativity with Practicality in ArchitectureRaquel Thompson: Combining  Creativity with Practicality in Architecture
Raquel Thompson: Combining Creativity with Practicality in Architecture
 
Call Girls in Noida Sector 12 Noida 💯Call Us 🔝 9582086666 🔝 South Delhi Escor...
Call Girls in Noida Sector 12 Noida 💯Call Us 🔝 9582086666 🔝 South Delhi Escor...Call Girls in Noida Sector 12 Noida 💯Call Us 🔝 9582086666 🔝 South Delhi Escor...
Call Girls in Noida Sector 12 Noida 💯Call Us 🔝 9582086666 🔝 South Delhi Escor...
 
Maha Mauka Squarefeet Brochure |Maha Mauka Squarefeet PDF Brochure|
Maha Mauka Squarefeet Brochure |Maha Mauka Squarefeet PDF Brochure|Maha Mauka Squarefeet Brochure |Maha Mauka Squarefeet PDF Brochure|
Maha Mauka Squarefeet Brochure |Maha Mauka Squarefeet PDF Brochure|
 
Pooja Mehta 9167673311 Get Warm Welcome By Andheri Escorts For Desired Fantasies
Pooja Mehta 9167673311 Get Warm Welcome By Andheri Escorts For Desired FantasiesPooja Mehta 9167673311 Get Warm Welcome By Andheri Escorts For Desired Fantasies
Pooja Mehta 9167673311 Get Warm Welcome By Andheri Escorts For Desired Fantasies
 

Hi5 opensocial-code-lab-presentation-1203814696810018-3

  • 2. hi5 - Dominant Global Social Network We are one of the largest web sites in the world (#8 on Alexa) and the most global of all the social networking sites.  Over 70+ million registered members and ~40 million WW unique users  Most popular Spanish-speaking social network in the world Top 10 in Latin America Mexico, Colombia, Bolivia, Guatemala, Peru, Costa Rica, Nicaragua, Honduras, Ecuador, El Salvador Top 10 in Rest of the World Portugal, Greece, Romania, Cyprus, Thailand, Jamaica, Sri Lanka, Kuwait, Jordan, Oman
  • 3. Hi5’s Demographics  Broad reach across major demos:  18 to 34 primary  Roughly 50%split male/female  US traffic: significant percentage is Hispanic  Diverse traffic from Europe (25%), North America (15%) and Central & South America (31%), Asia (21%)  Offered in 14 languages  Grew big in most international countries with English first and then translated  Members use the site primarily to keep in touch with their friends. Users have limited self-expression tools - skins, widgets, etc.
  • 4. Getting Started • A text editor, or the hi5 Gadget Editor • Web hosting, or the built-in hosting in the hi5 Gadget Editor • A hi5 account • Access to the hi5 sandbox
  • 5. Getting Started on sandbox.hi5.com
  • 6. Two ways to get your App going Sample App lets you Edit
  • 9. Integration Points • Preview Page • Profile Module • Canvas Page • Friend Updates • Notifications • App Invites • Emails
  • 10. Hello World <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Hello World!” author_email=”lou@hi5.com”> <Require feature="opensocial-0.7" /> </ModulePrefs> <Content type="html"> <![CDATA[ Hello, world! ]]> </Content> </Module>
  • 11. Hello World • <Module> indicates that this XML file contains a gadget. • <ModulePrefs> contains information about the gadget, and its author. • author_email must match your hi5 account’s email in the hi5 container • <Require feature="opensocial-0.7" /> denotes a required feature of the gadget — in this case, the OpenSocial API (v0.7). • <Content type="html"> indicates that the gadget's content type is HTML. • <![ CDATA[…]]> contains the bulk of the gadget, including all of the HTML, CSS, and JavaScript (or references to such files).
  • 13. Fetching Friends function loadFriends() { var req = opensocial.newDataRequest(); req.add(req.newFetchPersonRequest('VIEWER'), 'viewer'); req.add(req.newFetchPeopleRequest('VIEWER_F RIENDS'), 'viewerFriends'); req.send(onLoadFriends); }
  • 15. Handle the Response function onLoadFriends(data) { var viewer = data.get('viewer').getData(); var viewerFriends = data.get('viewerFriends').getData(); html = new Array(); html.push('<ul>'); viewerFriends.each(function(person) { html.push('<li>' + person.getDisplayName() + "</li>"); }); html.push('</ul>'); document.getElementById('friends').innerHTML = html.join(''); }
  • 19. 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(); }
  • 23. 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(''); }
  • 28. Displaying App Data function updateReceivedList(viewer, data, friends) { var viewerId = viewer.getId(); var options = ['a cashew nut', 'a peanut', 'a hazelnut', 'a red pistachio nut']; var html = new Array(); html.push('You have received:<ul>'); friends.each(function(person) { var personData = data[person.getId()]; if (personData) { var json = data[person.getId()]['gifts']; var gifts = {} if (!json) { gifts = {}; } try { gifts = gadgets.json.parse(json); } catch (e) { gifts = {}; } for (i in gifts) { if (+(i) > 0 && i == viewerId) { html.push('<li>' + options[gifts[i]] + ' from ' + person.getDisplayName() + '</li>'); } } } }); html.push('</ul>'); document.getElementById('recieved').innerHTML = html.join(''); }
  • 32. Creating Activity function createActivity(title) { var opts = new Array(); opts[opensocial.Activity.Field.TITLE] = title; opts[opensocial.Activity.Field.STREAM_FAVICON_URL] = 'http://images.hi5.com/images/icons/ _/update_widget.png'); var activity = opensocial.newActivity(opts); // Request the activity creation opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH); }
  • 34. 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); }
  • 37. Making Content Requests function getStatus() { var authToken = this.sandbox.hi5Container.params['Hi5AuthToken']; gadgets.io.makeRequest('http://api.hi5.com/rest/status/getStatus? userId='+viewer.getField(opensocial.Person.Field.ID) +'&Hi5AuthToken='+authToken, function(response) { var data = response.data; console.debug(response.text); var content = data.getElementsByTagName('content'); if(content.length == 1) { document.getElementById('status').innerHTML = "Your status: " + content.item(0).firstChild.nodeValue; } }, {'METHOD' : 'GET', 'CONTENT_TYPE' : 'DOM'}); }
  • 39. Working With Views <Content type=“html” view=“profile”> <![CDATA[ <script src="http://images.hi5.com/images/opensocial/gifts.js"></script> <script> gadgets.util.registerOnLoadHandler(initProfile); </script> <div id='main'> <div id='received’></div> </div> ]]> </Content>
  • 41. Navigating to a View function navToCanvas() { var views = gadgets.views.getSupportedViews(); gadgets.views.requestNavigateTo(views['canvas']); }
  • 44. Other Features • requestShareApp • requestSendMessage – EMAIL, PRIVATE_MESSAGE, PUBLIC_MESSAGE • Person Field extensions – SMALL_IMG_URL, MEDIUM_IMG_URL, LARGE_IMG_URL • Lifecycle Callbacks • Activity Templates
  • 45. hi5 Roadmap March 15: Hackathon geared towards launch preparation. Apps will be considered for whitelisting from this date until launch. March 31: Production launch