SlideShare uma empresa Scribd logo
1 de 74
OpenSocial
Chris Chabot
Agenda
• Introduction
• Social Custodians
• Building an OpenSocial Application
• What's next for OpenSocial
• Kinds of container
• Becoming an OpenSocial container
• Partner Presentation
The problem
The solution
®friendster
Who's part of OpenSocial?
> 390 Million reached!
What does OpenSocial Provide
Social Custodians
Of course you can't 'trust' what
people tell you on the web any
more than you can 'trust' what
people tell you on megaphones,
postcards or in restaurants
Douglas Adams
Working out the social politics of
who you can trust and why is,
quite literally, what a very large
part of our brain has evolved to
do
Douglas Adams
How to build an OpenSocial application
The Basics
How to make an OpenSocial Application
HTML / CSS / JS
XML
Understanding the Gadget XML
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Hello World!">
<Require feature="opensocial-0.7" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<script>
function init(){
alert("hello world");
}
gadgets.util.registerOnLoadHandler(init);
</script>
]]>
</Content>
</Module>
Retrieve Friend Information
function getFriendData() {
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(VIEWER), 'viewer');
req.add(req.newFetchPeopleRequest(VIEWER_FRIENDS),
'viewerFriends');
req.send(onLoadFriends);
}
function onLoadFriends(response) {
var viewer = response.get('viewer').getData();
var viewerFriends = response.get('viewerFriends').getData();
///More code
}
Persisting Data
function populateMyAppData() {
var req = opensocial.newDataRequest();
var data1 = Math.random() * 5;
var data2 = Math.random() * 100;
req.add(req.newUpdatePersonAppDataRequest(
"VIEWER","AppField1", data1));
req.add(req.newUpdatePersonAppDataRequest(
         "VIEWER","AppField2", data2));
req.send(requestMyData);
}
Fetching persisted data
function requestMyData() {
var req = opensocial.newDataRequest();
var fields = ["AppField1", "AppField2"];
req.add(req.newFetchPersonRequest(
opensocial.DataRequest.PersonId.VIEWER),"viewer");
req.add(req.newFetchPersonAppDataRequest("VIEWER",
fields), "viewer_data");
req.send(handleReturnedData);
}
function handleReturnedData(data) {
var mydata = data.get("viewer_data");
var viewer = data.get("viewer");
me = viewer.getData();
   var appField1 = mydata[me.getId()]["AppField1"];
///More code
}
Posting an Activity
function postActivity(text) {
var params = {};
params[opensocial.Activity.Field.TITLE] = text;
var activity = opensocial.newActivity(params);
opensocial.requestCreateActivity(activity,
opensocial.CreateActivityPriority.HIGH,
callback);
}
postActivity("This is a sample activity, created
at " + new Date().toString())
How to build an OpenSocial application
Best Practices
function response(data) {
if (!data.hadError()) {
...
} else {
if (data.get("req").hadError()) {
alert(data.get("req").getErrorMessage());
}
} else {
alert('Unknown error occurred');
};
Best practices : Check for errors
• Both the request and sub-requests can have 
errors, use hadError() to check.
function request() {
var req = opensocial.newDataRequest();
 var params = {};
 params[opensocial.DataRequest.PeopleRequestFields
     .PROFILE_DETAILS] = [
    opensocial.Person.Field.PROFILE_URL
 ];
req.add(req.newFetchPersonRequest(
opensocial.DataRequest.PersonId.VIEWER, params),
"req");
req.send(response);
};
Best practices : Be specific
• Specify which fields you want to use:
only ID, NAME and THUMBNAIL_URL are returned 
by default
var supportsAboutMe =
opensocial.getEnvironment().supportsField(
opensocial.Environment.ObjectType.PERSON,
         opensocial.Person.Field.ABOUT_ME 
);
Best practices : Capability Discovery
• Check for supported features and fields
Best practices : Capability Discovery
Netlog
• credits api extension
• translation tool for free 
MySpace 
• photo albums
• videos
 
if (gadgets.util.hasFeature('hi5')) {
mediaItem.setField(
hi5.ActivityMediaItemField.LINK,
         "http://linkurl");
}
Imeem
• music metadata api
 
hi5
• status
• presence
• photo albums
Best Practises : Use the container's cache
function showImage() {
imgUrl = 'http://foo.com/bar.png';
cachedUrl = gadgets.io.getProxyUrl(imgUrl);
html = ['<img src="', cachedUrl, '">'];
document.getElementById('dom_handle').innerHTML =
html.join('');
};
showImage();
Use the container's content cache
• Also check out
o Content-Rewriter feature
Best Practises : Preloading Content
<ModulePrefs title="Test Preloads">
<Preload href="http://www.example.com" />
</ModulePrefs>
gadgets.io.preloaded_ = {"http://www.example.com":
{"body":"...","rc":200}};
Becomes:
gadgets.io.makeRequest("http://www.example.com",
response);
So this will be instant:
Best practises : Web development 101
• Control the caching of your content, http headers:
o Cache-Control
o Last-Modified
o Expires
o E-Tag 
• Reduce number of http requests
o Combine JS and CSS files into one file
o Combine images into single sprite + CSS positioning 
• Use Google's AJAX libraries API
o  <script src="http://ajax.googleapis.com/.../prototype.js
• Other techniques:
o GZip content
o Minify JS and CSS
o See YSlow!
Hosting your application
• Host it anywhere you want to, with any back-end
• Keep in mind: 
o Popular apps like iLike get > 200k req / minute peak
o Means dealing with lots of scalability issues!
o DB Sharding, memcache pools, server farms..
• Why not use a cloud service like:
o Google App Engine
o Joyent.com
o Amazon EC2
Specification
http://opensocial.org/
http://groups.google.com/group/opensocial-and-gadgets-spec
Code Samples and Tools
http://code.google.com/opensocial
http://code.google.com/p/opensocial-resources/
 
Getting started guide
http://code.google.com/apis/opensocial/articles/tutorial/tutorial-
0.8.html
Application Development Resources
What's next for OpenSocial
OpenSocial 0.8 - REST API
• Access social data without JavaScript
• Works on 3rd party websites / phones / etc
• Uses OAuth to allow secure access
• Open source client libraries in development
o Java, PHP, Python, <your fav language here>
OpenSocial 0.8 - Templates
• Writing JavaScript is hard
• Writing templates is easy
• Templates also give
o Consistent UI across containers
o Easy way to localize
o More interesting content options when inlining 
into container (activities, profile views)
o Ability to serve millions of dynamic pages per 
day without a server
Example: Friends list (no templates)
 
Example: Friends list (with templates)
 
http://ostemplates-demo.appspot.com/
OpenSocial 0.8 - Other Changes
• Portable Contacts alignment
• Friends-of-Friends & filter support
• Life-Cycle events
• Link Elements: gadgetsHelp, gadgetsSupport
• Inline MessageBundles
OpenSocial 0.9 - Being formed now
• Proxied Content - Classic style of web development
• OSML - Server sided templating
• Media & Album API
• <Your Idea here>
http://groups.google.com/group/opensocial-and-gadgets-spec
Kinds of Containers
Containers provide a social context
• OpenSocial separates application logic from social context
• an app sees user ids - the container makes them people
• Users understand the social contract of the containers
• Save apps and users from re-registration hell
Containers don’t choose users
• Containers set up the social model, users choose to join
• they grow through homophily and affinity
• Network effect can bring unexpected userbases
OpenSocial gets you to all their users
• You don't have to pick a site to specialise for
• You get to spread through multiple friend groups
• You'll be surprised by where your users are
• so make sure you plan to localize
Not just Social Network Sites
• Social network sites - Profiles and home pages
• Personal dashboards
• Sites based around a Social Object
• Corporate CRM systems
• Any web site
How do we abstract these out?
• Viewer + friends
• Owner + friends
The Viewer and Viewer friends
Owner and Owner friends
Owner and Viewer
are defined by Container
The Application gets IDs and connections to other IDs
the Owner need not be a Person
It could be an organisation
or a social object
Kinds of container - Social network
sites
• Profile pages
o Owner is profile page owner
o Viewer may not be known, may be owner or other
member
• Home pages
o Owner is Viewer (must be logged in to see)
Examples
• MySpace
• Hi5
• Orkut
Kinds of container - Personal
dashboard
• like Home pages
o Owner is Viewer (must be logged in to see)
• Friends may not be defined
Example:
• iGoogle, My Yahoo
Kinds of container - Social Object site
• Pages reflect the object - movie, picture, product
o Owner is the object
o Owner friends are people connected to the object
 may be authors or fans
o Viewer is looking at it, Viewer friends are people you may
want to share with
Example:
• Imeem is a bit like this
• Opportunity for sites like Flickr, YouTube
Kinds of container - CRM systems
• Pages reflect the customer
o Owner is the customer
o Owner friends are people connected to the customer
 may be your colleagues, or other customers
o Viewer is you, Viewer friends are your colleagues or
customers
Example:
• Oracle CRM, Salesforce
Kinds of container - Any web site
• Owner is the site
o Owner friends are site users
• Viewer is you,
o Viewer friends are your friends who have visited this site
Example:
• Google Friend Connect will enable this for any site
Becoming an OpenSocial Container
Becoming an OpenSocial Container
• Question:
o How do you become an OpenSocial container?
• Answer:
o The Apache incubator project “Shindig” serves this
purpose!
What is Shindig ?
• Open source reference implementation of OpenSocial &
Gadgets specification
• An Apache Software Incubator project
• Available in Java & PHP
• http://incubator.apache.org/shindig
It’s Goal:
“Shindig's goal is to allow new sites to start hosting social apps
in under an hour's worth of work"
Introduction to Shindig Architecture
• Gadget Server
• Social Data Server
• Gadget JavaScript
Gadget Server
Social Server
Implementing Shindig - PHP
• Integrate with your own data sources
o People Service
o Activities Service
o App Data Service
class MyPeopleService implements PeopleService {
...
}
class MyAppDataService implements AppDataService {
...
}
class MyActivitiesService implements ActivitiesService
{
...
}
Implementing Shindig - PHP
• Implement functions
function getActivities($ids)
{
$activities = array();
$res = mysqli_query($this->db, ”SELECT…");
while ($row = @mysqli_fetch_array($res,MYSQLI_ASSOC)){
$activity = new Activity($row['activityId'],
$row['personId']);
$activity->setStreamTitle($row['activityStream']);
$activity->setTitle($row['activityTitle']);
$activity->setBody($row['activityBody']);
$activity->setPostedTime($row['created']);
$activities[] = $activity;
}
return $activities;
}
Implementing Shindig - Java
import org.apache.shindig.social.opensocial.ActivitiesService;
public class SQLActivitiesService implements ActivitiesService {
private SQLDataLayer sqlLayer;
@Inject
public SQLActivitiesService(SQLDataLayer sqlLayer)
{
this.sqlLayer = sqlLayer;
....
public ResponseItem<List<Activity>> getActivities(List<String> ids,
SecurityToken token) {
Map<String, List<Activity>> allActivities = sqlLayer.getActivities();
List<Activity> activities = new ArrayList<Activity>();
for (String id : ids) {
List<Activity> personActivities =
allActivities.get(id);
if (personActivities != null) {
activities.addAll(personActivities);
}
}
return new ResponseItem<List<Activity>>(activities);
}
Implementing Shindig - Java
Implementing - Make it a platform
• Add UI Elements
o App Gallery
o App Canvas
o App Invites
o Notification Browser
• Developer Resources
o Developer Console
o Application Statistics
Implementing - Scale it Out
• Prevent Concurrency issues
• Reduce Latency
• Add lots of Caching
Usage Example: Sample Container
• Static html sample container
• No effort to get up and running
• No database or features
Usage Example: Partuza
• Partuza is a Example social network site, written in PHP
• Allows for local gadget development & testing too
• Use as inspiration (or copy) for creating your own social site
• http://code.google.com/p/partuza
OpenSocial for intranet, portals
Sun Microsystems
• Socialsite: Shindig + gadget based UI written in Java
• Open Source https://socialsite.dev.java.net/
Upcoming from Impetus
• Zest: Shindig + Drupal (PHP)
• Zeal: Shindig + Liferay (Java)
Becoming a Container - Summary
• Become an OpenSocial Container
o Get Shindig (PHP or Java)
 http://incubator.apache.org/shindig/
o Look at examples & documentation
 http://www.chabotc.com/gdd
o Implement Services
o Add UI
o Scale it out
• Get involved, join the mailing list!
mail.ru
Q & A
Learn more at
code.google.com

Mais conteúdo relacionado

Semelhante a GDD Moscow - Open Social

The business behind open source
The business behind open sourceThe business behind open source
The business behind open sourceGraham Weldon
 
Data Foundation for Analytics Excellence by Tanimura, cathy from Okta
Data Foundation for Analytics Excellence by Tanimura, cathy from OktaData Foundation for Analytics Excellence by Tanimura, cathy from Okta
Data Foundation for Analytics Excellence by Tanimura, cathy from OktaTin Ho
 
Buiding application for social networks
Buiding application for social networksBuiding application for social networks
Buiding application for social networksĐỗ Duy Trung
 
Stem digital module 1 launch
Stem digital module 1 launchStem digital module 1 launch
Stem digital module 1 launchHelen Webster
 
Building a community - BuildStuff Lithuania 2014
Building a community - BuildStuff Lithuania 2014Building a community - BuildStuff Lithuania 2014
Building a community - BuildStuff Lithuania 2014Gill Cleeren
 
Tools for Entrepreneurs: Create. Collaborate. Communicate.
Tools for Entrepreneurs: Create. Collaborate. Communicate.Tools for Entrepreneurs: Create. Collaborate. Communicate.
Tools for Entrepreneurs: Create. Collaborate. Communicate.Sara Rosso
 
Sourcing with Social Media: Tips from a Corporate Sleuth by Sean Campbell
Sourcing with Social Media: Tips from a Corporate Sleuth by Sean CampbellSourcing with Social Media: Tips from a Corporate Sleuth by Sean Campbell
Sourcing with Social Media: Tips from a Corporate Sleuth by Sean CampbellReynolds Center for Business Journalism
 
How to work with virtual volunteers
How to work with virtual volunteersHow to work with virtual volunteers
How to work with virtual volunteersTemi Adewumi
 
How to Source, Recruit & Attract Humans with Social Media and Employer Branding
How to Source, Recruit & Attract Humans  with Social Media and Employer BrandingHow to Source, Recruit & Attract Humans  with Social Media and Employer Branding
How to Source, Recruit & Attract Humans with Social Media and Employer BrandingAlex Putman
 
Social media architecture
Social media architectureSocial media architecture
Social media architectureDean Da Costa
 
CRC-STC May 2013 Summit Presentation
CRC-STC May 2013 Summit PresentationCRC-STC May 2013 Summit Presentation
CRC-STC May 2013 Summit Presentationcrcstc
 
Guide to open source
Guide to open source Guide to open source
Guide to open source Javier Perez
 
Using social media to promote your research
Using social media to promote your researchUsing social media to promote your research
Using social media to promote your researchHazel Hall
 
Goodle Developer Days Munich 2008 - Open Social Update
Goodle Developer Days Munich 2008 - Open Social UpdateGoodle Developer Days Munich 2008 - Open Social Update
Goodle Developer Days Munich 2008 - Open Social UpdatePatrick Chanezon
 
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
 
Techorama 2022 - Adventures of building Promitor, an open-source product
Techorama 2022 - Adventures of building Promitor, an open-source productTechorama 2022 - Adventures of building Promitor, an open-source product
Techorama 2022 - Adventures of building Promitor, an open-source productTom Kerkhove
 
Making and sharing content online
Making and sharing content onlineMaking and sharing content online
Making and sharing content onlineHelen Webster
 
Professional Portfolios
Professional PortfoliosProfessional Portfolios
Professional PortfoliosLouellen Coker
 
Social networks: technical issues
Social networks: technical issuesSocial networks: technical issues
Social networks: technical issuesMorgan Magnin
 

Semelhante a GDD Moscow - Open Social (20)

The business behind open source
The business behind open sourceThe business behind open source
The business behind open source
 
Data Foundation for Analytics Excellence by Tanimura, cathy from Okta
Data Foundation for Analytics Excellence by Tanimura, cathy from OktaData Foundation for Analytics Excellence by Tanimura, cathy from Okta
Data Foundation for Analytics Excellence by Tanimura, cathy from Okta
 
Buiding application for social networks
Buiding application for social networksBuiding application for social networks
Buiding application for social networks
 
Stem digital module 1 launch
Stem digital module 1 launchStem digital module 1 launch
Stem digital module 1 launch
 
Building a community - BuildStuff Lithuania 2014
Building a community - BuildStuff Lithuania 2014Building a community - BuildStuff Lithuania 2014
Building a community - BuildStuff Lithuania 2014
 
Tools for Entrepreneurs: Create. Collaborate. Communicate.
Tools for Entrepreneurs: Create. Collaborate. Communicate.Tools for Entrepreneurs: Create. Collaborate. Communicate.
Tools for Entrepreneurs: Create. Collaborate. Communicate.
 
Sourcing with Social Media: Tips from a Corporate Sleuth by Sean Campbell
Sourcing with Social Media: Tips from a Corporate Sleuth by Sean CampbellSourcing with Social Media: Tips from a Corporate Sleuth by Sean Campbell
Sourcing with Social Media: Tips from a Corporate Sleuth by Sean Campbell
 
How to work with virtual volunteers
How to work with virtual volunteersHow to work with virtual volunteers
How to work with virtual volunteers
 
How to Source, Recruit & Attract Humans with Social Media and Employer Branding
How to Source, Recruit & Attract Humans  with Social Media and Employer BrandingHow to Source, Recruit & Attract Humans  with Social Media and Employer Branding
How to Source, Recruit & Attract Humans with Social Media and Employer Branding
 
Social media architecture
Social media architectureSocial media architecture
Social media architecture
 
CRC-STC May 2013 Summit Presentation
CRC-STC May 2013 Summit PresentationCRC-STC May 2013 Summit Presentation
CRC-STC May 2013 Summit Presentation
 
Wordpress Presentation
Wordpress Presentation Wordpress Presentation
Wordpress Presentation
 
Guide to open source
Guide to open source Guide to open source
Guide to open source
 
Using social media to promote your research
Using social media to promote your researchUsing social media to promote your research
Using social media to promote your research
 
Goodle Developer Days Munich 2008 - Open Social Update
Goodle Developer Days Munich 2008 - Open Social UpdateGoodle Developer Days Munich 2008 - Open Social Update
Goodle Developer Days Munich 2008 - Open Social Update
 
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
 
Techorama 2022 - Adventures of building Promitor, an open-source product
Techorama 2022 - Adventures of building Promitor, an open-source productTechorama 2022 - Adventures of building Promitor, an open-source product
Techorama 2022 - Adventures of building Promitor, an open-source product
 
Making and sharing content online
Making and sharing content onlineMaking and sharing content online
Making and sharing content online
 
Professional Portfolios
Professional PortfoliosProfessional Portfolios
Professional Portfolios
 
Social networks: technical issues
Social networks: technical issuesSocial networks: technical issues
Social networks: technical issues
 

Último

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Último (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

GDD Moscow - Open Social

  • 1.
  • 3. Agenda • Introduction • Social Custodians • Building an OpenSocial Application • What's next for OpenSocial • Kinds of container • Becoming an OpenSocial container • Partner Presentation
  • 4.
  • 5.
  • 6.
  • 9. ®friendster Who's part of OpenSocial? > 390 Million reached!
  • 10.
  • 13. Of course you can't 'trust' what people tell you on the web any more than you can 'trust' what people tell you on megaphones, postcards or in restaurants Douglas Adams
  • 14. Working out the social politics of who you can trust and why is, quite literally, what a very large part of our brain has evolved to do Douglas Adams
  • 15.
  • 16.
  • 17. How to build an OpenSocial application The Basics
  • 18. How to make an OpenSocial Application HTML / CSS / JS XML
  • 19. Understanding the Gadget XML <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Hello World!"> <Require feature="opensocial-0.7" /> </ModulePrefs> <Content type="html"> <![CDATA[ <script> function init(){ alert("hello world"); } gadgets.util.registerOnLoadHandler(init); </script> ]]> </Content> </Module>
  • 20. Retrieve Friend Information function getFriendData() { var req = opensocial.newDataRequest(); req.add(req.newFetchPersonRequest(VIEWER), 'viewer'); req.add(req.newFetchPeopleRequest(VIEWER_FRIENDS), 'viewerFriends'); req.send(onLoadFriends); } function onLoadFriends(response) { var viewer = response.get('viewer').getData(); var viewerFriends = response.get('viewerFriends').getData(); ///More code }
  • 21. Persisting Data function populateMyAppData() { var req = opensocial.newDataRequest(); var data1 = Math.random() * 5; var data2 = Math.random() * 100; req.add(req.newUpdatePersonAppDataRequest( "VIEWER","AppField1", data1)); req.add(req.newUpdatePersonAppDataRequest(          "VIEWER","AppField2", data2)); req.send(requestMyData); }
  • 22. Fetching persisted data function requestMyData() { var req = opensocial.newDataRequest(); var fields = ["AppField1", "AppField2"]; req.add(req.newFetchPersonRequest( opensocial.DataRequest.PersonId.VIEWER),"viewer"); req.add(req.newFetchPersonAppDataRequest("VIEWER", fields), "viewer_data"); req.send(handleReturnedData); } function handleReturnedData(data) { var mydata = data.get("viewer_data"); var viewer = data.get("viewer"); me = viewer.getData();    var appField1 = mydata[me.getId()]["AppField1"]; ///More code }
  • 23. Posting an Activity function postActivity(text) { var params = {}; params[opensocial.Activity.Field.TITLE] = text; var activity = opensocial.newActivity(params); opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH, callback); } postActivity("This is a sample activity, created at " + new Date().toString())
  • 25. function response(data) { if (!data.hadError()) { ... } else { if (data.get("req").hadError()) { alert(data.get("req").getErrorMessage()); } } else { alert('Unknown error occurred'); }; Best practices : Check for errors • Both the request and sub-requests can have  errors, use hadError() to check.
  • 26. function request() { var req = opensocial.newDataRequest();  var params = {};  params[opensocial.DataRequest.PeopleRequestFields      .PROFILE_DETAILS] = [     opensocial.Person.Field.PROFILE_URL  ]; req.add(req.newFetchPersonRequest( opensocial.DataRequest.PersonId.VIEWER, params), "req"); req.send(response); }; Best practices : Be specific • Specify which fields you want to use: only ID, NAME and THUMBNAIL_URL are returned  by default
  • 28. Best practices : Capability Discovery Netlog • credits api extension • translation tool for free  MySpace  • photo albums • videos   if (gadgets.util.hasFeature('hi5')) { mediaItem.setField( hi5.ActivityMediaItemField.LINK,          "http://linkurl"); } Imeem • music metadata api   hi5 • status • presence • photo albums
  • 29. Best Practises : Use the container's cache function showImage() { imgUrl = 'http://foo.com/bar.png'; cachedUrl = gadgets.io.getProxyUrl(imgUrl); html = ['<img src="', cachedUrl, '">']; document.getElementById('dom_handle').innerHTML = html.join(''); }; showImage(); Use the container's content cache • Also check out o Content-Rewriter feature
  • 30. Best Practises : Preloading Content <ModulePrefs title="Test Preloads"> <Preload href="http://www.example.com" /> </ModulePrefs> gadgets.io.preloaded_ = {"http://www.example.com": {"body":"...","rc":200}}; Becomes: gadgets.io.makeRequest("http://www.example.com", response); So this will be instant:
  • 31. Best practises : Web development 101 • Control the caching of your content, http headers: o Cache-Control o Last-Modified o Expires o E-Tag  • Reduce number of http requests o Combine JS and CSS files into one file o Combine images into single sprite + CSS positioning  • Use Google's AJAX libraries API o  <script src="http://ajax.googleapis.com/.../prototype.js • Other techniques: o GZip content o Minify JS and CSS o See YSlow!
  • 32. Hosting your application • Host it anywhere you want to, with any back-end • Keep in mind:  o Popular apps like iLike get > 200k req / minute peak o Means dealing with lots of scalability issues! o DB Sharding, memcache pools, server farms.. • Why not use a cloud service like: o Google App Engine o Joyent.com o Amazon EC2
  • 33. Specification http://opensocial.org/ http://groups.google.com/group/opensocial-and-gadgets-spec Code Samples and Tools http://code.google.com/opensocial http://code.google.com/p/opensocial-resources/   Getting started guide http://code.google.com/apis/opensocial/articles/tutorial/tutorial- 0.8.html Application Development Resources
  • 35. OpenSocial 0.8 - REST API • Access social data without JavaScript • Works on 3rd party websites / phones / etc • Uses OAuth to allow secure access • Open source client libraries in development o Java, PHP, Python, <your fav language here>
  • 36. OpenSocial 0.8 - Templates • Writing JavaScript is hard • Writing templates is easy • Templates also give o Consistent UI across containers o Easy way to localize o More interesting content options when inlining  into container (activities, profile views) o Ability to serve millions of dynamic pages per  day without a server
  • 37. Example: Friends list (no templates)  
  • 38. Example: Friends list (with templates)   http://ostemplates-demo.appspot.com/
  • 39. OpenSocial 0.8 - Other Changes • Portable Contacts alignment • Friends-of-Friends & filter support • Life-Cycle events • Link Elements: gadgetsHelp, gadgetsSupport • Inline MessageBundles
  • 40. OpenSocial 0.9 - Being formed now • Proxied Content - Classic style of web development • OSML - Server sided templating • Media & Album API • <Your Idea here> http://groups.google.com/group/opensocial-and-gadgets-spec
  • 42. Containers provide a social context • OpenSocial separates application logic from social context • an app sees user ids - the container makes them people • Users understand the social contract of the containers • Save apps and users from re-registration hell
  • 43. Containers don’t choose users • Containers set up the social model, users choose to join • they grow through homophily and affinity • Network effect can bring unexpected userbases
  • 44. OpenSocial gets you to all their users • You don't have to pick a site to specialise for • You get to spread through multiple friend groups • You'll be surprised by where your users are • so make sure you plan to localize
  • 45. Not just Social Network Sites • Social network sites - Profiles and home pages • Personal dashboards • Sites based around a Social Object • Corporate CRM systems • Any web site How do we abstract these out? • Viewer + friends • Owner + friends
  • 46. The Viewer and Viewer friends
  • 47. Owner and Owner friends
  • 48. Owner and Viewer are defined by Container The Application gets IDs and connections to other IDs
  • 49. the Owner need not be a Person It could be an organisation or a social object
  • 50. Kinds of container - Social network sites • Profile pages o Owner is profile page owner o Viewer may not be known, may be owner or other member • Home pages o Owner is Viewer (must be logged in to see) Examples • MySpace • Hi5 • Orkut
  • 51. Kinds of container - Personal dashboard • like Home pages o Owner is Viewer (must be logged in to see) • Friends may not be defined Example: • iGoogle, My Yahoo
  • 52. Kinds of container - Social Object site • Pages reflect the object - movie, picture, product o Owner is the object o Owner friends are people connected to the object  may be authors or fans o Viewer is looking at it, Viewer friends are people you may want to share with Example: • Imeem is a bit like this • Opportunity for sites like Flickr, YouTube
  • 53. Kinds of container - CRM systems • Pages reflect the customer o Owner is the customer o Owner friends are people connected to the customer  may be your colleagues, or other customers o Viewer is you, Viewer friends are your colleagues or customers Example: • Oracle CRM, Salesforce
  • 54. Kinds of container - Any web site • Owner is the site o Owner friends are site users • Viewer is you, o Viewer friends are your friends who have visited this site Example: • Google Friend Connect will enable this for any site
  • 56. Becoming an OpenSocial Container • Question: o How do you become an OpenSocial container? • Answer: o The Apache incubator project “Shindig” serves this purpose!
  • 57. What is Shindig ? • Open source reference implementation of OpenSocial & Gadgets specification • An Apache Software Incubator project • Available in Java & PHP • http://incubator.apache.org/shindig It’s Goal: “Shindig's goal is to allow new sites to start hosting social apps in under an hour's worth of work"
  • 58. Introduction to Shindig Architecture • Gadget Server • Social Data Server • Gadget JavaScript
  • 61. Implementing Shindig - PHP • Integrate with your own data sources o People Service o Activities Service o App Data Service class MyPeopleService implements PeopleService { ... } class MyAppDataService implements AppDataService { ... } class MyActivitiesService implements ActivitiesService { ... }
  • 62. Implementing Shindig - PHP • Implement functions function getActivities($ids) { $activities = array(); $res = mysqli_query($this->db, ”SELECT…"); while ($row = @mysqli_fetch_array($res,MYSQLI_ASSOC)){ $activity = new Activity($row['activityId'], $row['personId']); $activity->setStreamTitle($row['activityStream']); $activity->setTitle($row['activityTitle']); $activity->setBody($row['activityBody']); $activity->setPostedTime($row['created']); $activities[] = $activity; } return $activities; }
  • 63. Implementing Shindig - Java import org.apache.shindig.social.opensocial.ActivitiesService; public class SQLActivitiesService implements ActivitiesService { private SQLDataLayer sqlLayer; @Inject public SQLActivitiesService(SQLDataLayer sqlLayer) { this.sqlLayer = sqlLayer; ....
  • 64. public ResponseItem<List<Activity>> getActivities(List<String> ids, SecurityToken token) { Map<String, List<Activity>> allActivities = sqlLayer.getActivities(); List<Activity> activities = new ArrayList<Activity>(); for (String id : ids) { List<Activity> personActivities = allActivities.get(id); if (personActivities != null) { activities.addAll(personActivities); } } return new ResponseItem<List<Activity>>(activities); } Implementing Shindig - Java
  • 65. Implementing - Make it a platform • Add UI Elements o App Gallery o App Canvas o App Invites o Notification Browser • Developer Resources o Developer Console o Application Statistics
  • 66. Implementing - Scale it Out • Prevent Concurrency issues • Reduce Latency • Add lots of Caching
  • 67. Usage Example: Sample Container • Static html sample container • No effort to get up and running • No database or features
  • 68. Usage Example: Partuza • Partuza is a Example social network site, written in PHP • Allows for local gadget development & testing too • Use as inspiration (or copy) for creating your own social site • http://code.google.com/p/partuza
  • 69. OpenSocial for intranet, portals Sun Microsystems • Socialsite: Shindig + gadget based UI written in Java • Open Source https://socialsite.dev.java.net/ Upcoming from Impetus • Zest: Shindig + Drupal (PHP) • Zeal: Shindig + Liferay (Java)
  • 70. Becoming a Container - Summary • Become an OpenSocial Container o Get Shindig (PHP or Java)  http://incubator.apache.org/shindig/ o Look at examples & documentation  http://www.chabotc.com/gdd o Implement Services o Add UI o Scale it out • Get involved, join the mailing list!
  • 72. Q & A
  • 73.