SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
Social Media Programming
              Khanderao Kand
                    CTO
               GloMantra Inc
   mybantu virtual personalized Assistance

                 @khanderao
    Nov 2, 2011 at JAX Conference, London
Khanderao Kand
CTO of Glomantra and myBantu in Silicon Valley, CA, USA
  AI based Relevance platform / recommendation technology with Social
  Intelligence
  Projects on Big Data, Computing, Machine Learning, Text Analytics, SOA, User
  Interest profiling, Yield Optimization

BIO:
  20 years in Industry (currently AI, SOA, Social, Mobile and Cloud Technologies)
  Lead Oracle’s SOA and BPM Architecture
  Chief Consulting Architect for SOA and BPM to 50+ architects & hundreds of
  developers of Oracle’s next Generation Fusion Apps
  Lead Architect of Peopletools
  Architect in CRM, Online Dialog Marketing, OLAP Hyperion
  Participated in Standards of BPEL and SCA at OASIS
  9 Patents filled
  Frequent Speaker in conferences
  Authored articles in JDJ, WSJ, Cloud Computing
Agenda


APIs, Frameworks and Tools for Social Computing:
  Key Technologies, APIs Interfacing with Popular Social
  media
  Storage
  Social Media Data Processing
Foundational Protocols and
Standards for Social Media
OAuth
OAuth is open standard for Authorizing Access (typically data access / actions)

Oauth hands over access token and not user credentials

Oauth is essential to developing social-ready applications

OAuth protocol (Dance) involves series of 3 party (consumer browser, Service provider –
Social media Site and App).

OAuth, including Twitter, Facebook, LinkedIn, TripIt, and Foursquare, as well as the Google
and Yahoo APIs.

Different SM supports either Oauth 1.0 and Oauth 2.0

Visit : http://oauth.net

APIs: Jersery (JAX-RS), Spring Security API, Googlecode,
Open ID

Open ID is open source standard for multi-site authentication
 OpenId is for authentication as against Oauth
No need of adhoc and site specific authentication
Oauth and OpenID can coexist
Open ID providers : think of Google login
Providers pass ID attributes to the relying party (app)
However, Oauth is more popular and common in Social Media
interfaces
Visit http://www.openid.org
Java API: openid4java, GAE supports,
REST

Representational State Transfer (Roy Fielding’s paper for
Architectural Style over HTTP)

Basic GET, PUT, POST, DELETE operations on a resource

Internet world REST is currently winning

Google, Yahoo, Facebook, etc etc.

Java: Jersey (JAX-RS), Restlet, RestFul Services, JAX-WS
JSON


Javascript Simple Object Notation as lightweight data
interchange format
Lighter than XML
Can be manipulated on browsers
No need for parsing into DOM
http://www.json.org
Java API: GSON, Jackson, JSONLib, FlexJSON
XML to/from JSON conversion: JSONLib
RSS


Really Simple Syndication (originally RDF Site Summary)
Started with news, site, blogs update
Simple and lightweight
Popular Readers: Google Reader, Feedly etc
Java API: ROME, Simple XML parsing
APIs of Popular Social Media
Facebook Graph API
Representing objects and relationships in Facebook’s social
network
Simple, consistent and REST style representation
Objects: People, events, pages, and photos
  People: http://graph.facebook.com/659690992/picture
  Events: http://graph.facebook.com/331218348435/picture
  Groups: http://graph.facebook.com/69048030774/picture
  Pages: http://graph.facebook.com/DoloresPark/picture
  Applications: http://graph.facebook.com/2318966938/picture
  Photo Albums: http://graph.facebook.com/platform/picture
Access API:   https://graph.facebook.com/ID/CONNECTION_TYPE
Facebook Graph API: Access
https://graph.facebook.com/ID/CONNECTION_TYPE
Friends: https://graph.facebook.com/me/friends?access_token=...
News feed: https://graph.facebook.com/me/home?access_token=...
Profile feed (Wall): https://graph.facebook.com/me/feed?access_token=...
Likes: https://graph.facebook.com/me/likes?access_token=...
Movies: https://graph.facebook.com/me/movies?access_token=...
Music: https://graph.facebook.com/me/music?access_token=...
Books: https://graph.facebook.com/me/books?access_token=...
Notes: https://graph.facebook.com/me/notes?access_token=...
Permissions: https://graph.facebook.com/me/permissions?access_token=...
Photo Tags: https://graph.facebook.com/me/photos?access_token=...
Photo Albums: https://graph.facebook.com/me/albums?access_token=...
Video Tags: https://graph.facebook.com/me/videos?access_token=...
Video Uploads: https://graph.facebook.com/me/videos/uploaded?access_token=...
Events: https://graph.facebook.com/me/events?access_token=...
Groups: https://graph.facebook.com/me/groups?access_token=...
Checkins: https://graph.facebook.com/me/checkins?access_token=…
Facebook Search using Graph API
All public objects
https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE

All public posts:
https://graph.facebook.com/search?q=socialcommerce&type=post
People: https://graph.facebook.com/search?q=Khanderao&type=user
Pages: https://graph.facebook.com/search?q=glomantra&type=page
Events: https://graph.facebook.com/search?q=conference&type=event
Groups: https://graph.facebook.com/search?q=programming&type=group
Places:
https://graph.facebook.com/search?q=coffee&type=place&center=37.76,122.42
7&distance=1000
Checkins: https://graph.facebook.com/search?type=checkin
Facebook: Publishing on Wall


HTTP Post
Access token
curl -F 'access_token=...' 
https://graph.facebook.com/313449204401/likes
Example
String url = "https://graph.facebook.com/"+facebook ID+"/feed";
String data = URLEncoder.encode("access_token", "UTF-8") + "=" + URLEncoder.encode(“ACCESS TOKEN STRING”, "UTF-8");

data += "&" + URLEncoder.encode("message", "UTF-8") + "=" + URLEncoder.encode(“wallMessageText”, "UTF-8");

data += "&" + URLEncoder.encode("picture", "UTF-8") + "=" + URLEncoder.encode(”IMAGE URL”, "UTF-8");

data += "&" + URLEncoder.encode("name", "UTF-8") + "=" + URLEncoder.encode(“POST TITLE STRING”, "UTF-8");

data += "&" + URLEncoder.encode("caption", "UTF-8") + "=" + URLEncoder.encode(“CAPTION STRING”, "UTF-8");

data += "&" + URLEncoder.encode("description", "UTF-8") + "=" + URLEncoder.encode(“DESCRIPTION”, "UTF-8");

data += "&" + URLEncoder.encode("actions", "UTF-8") + "=" + URLEncoder.encode("{"name": ”action_name", "link": ”
http://192.169.0.46/app/valid url1"}", "UTF-8");

data += "&" + URLEncoder.encode("link", "UTF-8") + "=" + URLEncoder.encode(“LINK URL”, "UTF-8");

// Constructing action links
JSONObject obj = new JSONObject();
LinkedHashMap<String, Object> m1 = new LinkedHashMap<String, Object>();
m1.put("text“,”LINK1 TEXT”);
m1.put("href", “http://192.169.0.46/app/valid action url1”);
obj.put(”LINK1 LABEL”, m1);
Twitter

Twitter is ranked as one of the ten-most-visited websites
worldwide by Alexa's web traffic analysis.

March 2010 10 billionth tweet

Twitter has a user retention rate of forty percent.

Value: Conversational 30%, Pointless Babble 30%, Promotion
8%, News 8%, news 7-8% and spam

Good source: news validation, trend, topic updates
Twitter Usage
"Twitter Revolutions" and which include the 2011 Egyptian
revolution, 2010–2011 Tunisian protests, 2009–2010 Iranian election
protests, and 2009 Moldova civil unrest
Twitter is also increasingly used for making TV more interactive and
social
Most of the celebrities are on Twitter
President Obama and many others effectively used Twitter for
campaigning
Twitter has become a great source for latest news
Twitter is an indicator for buzz around latest topics and trends
Brands are using twitters for promotions of products and spreading
deals
3rd party Twitter Java APIs


Twitter4J : Open Source BSD

Java-Twitter

Jtwitter : Open Source

Twitter Client Streaming API
Twitter


Twitter API allows to
  Tweet
  Direct message
  Search
  Get tweets
Twitter4J API

  Twitter4J (third party – open source)
  Access token / consumer key in twitter.properties

Twitter twitter = new TwitterFactory().getInstance();
Query query = new Query(”mybantu");
QueryResult result = twitter.search(query);
// uodate status
Status status = twitter.updateStatus(latestStatus);
Twitter Fire hose



GNIP 50% at approximately 360K per year
  For analysis but not for resale or display tweets
Spritzer 2% random for free
Open Social Project
"For the question about Google plans to allow developers to
create Google+ apps deploying the OpenSocial APIs, a
spokeswoman of Google said that by means of email nowadays
the Google+ platform can’t support the OpenSocial APIs.

She also added that nevertheless, they are utilizing many of the
technology which was designed as part of OpenSocial, along with
the gadget application packaging model, and power Google+
games and the Portable Contacts JSON schema. Because they
define the +Platform APIs, they are drawing close attention to the
future tendency of the OpenSocial APIs, as well as converging
everything possible."
Developing Social Network


Apache Opensource project in incubation
  Shindig
Open Social

Great initiative with huge promise
  A common “open source” API for social media launched in 2007
  Early movers as open social containers: Google
  Orkut, hi5, LinkedIn, MySpace, Netlog, Ning, orkut, and Yahoo!
  Opensource OpenSocial Based container : Apache Shindig

Bummer…
  Except Facebook
  Google+ is not yet committed to Open Social
Google Social Graph API

By supporting open Web standards
for describing connections between
people, web sites can add to the
social infrastructure of the web

The API returns web addresses of
public pages and publicly declared
connections between them.

Allows developers to create a button
for a Web site that would allow a
registered user to easily "add
friends.”
index the public Web for Friends of A
Friend (FOAF) and Friends Network
Google’s Public Social Graph
     The Social Graph API looks for two
     types of publicly declared
     connections:

1.    It looks for all public URLs that
      belong to you and are
      interconnected. This could be
      your blog (a1), your LiveJournal
      page (a2), and your Twitter
      account (a3).

2. It looks for publicly declared
   connections between people.
   For example, a1 may link to b's
   blog while a1 and c link to each
   other.
Google+ API
 https://developers.google.com/+/api/
Searching Public posts
GET
https://www.googleapis.com/plus/v1/activities?query=cookie%20recipes
&orderBy=best&key=[yourAPIKey]

People Search

GET
https://www.googleapis.com/plus/v1/people?query=Khanderao%20kand
&key=[yourAPIKey]

View People Interacting with Posts
GET
https://www.googleapis.com/plus/v1/activities/{activityId}/people/resha
rers?key=[yourAPIKey] GET
https://www.googleapis.com/plus/v1/activities/{activityId}/people/pluso
ners?key=[yourAPIKey]
Spring Social
Spring Social provides templates for
        REST based API handling OAUth and
        providing operations specific to Social Media

  TwitterTemplate
  FacebookTemplate
  LinkedInTemplate
  TripItTemplate

  http://blog.springsource.com/2010/11/03/socializing-spring-
  applications/
  http://greenhouse.springsource.org
Technologies for Building
Applications on Social Media
Social Media Data Often Needs
         Different Type of Database

  Social Media Contains: Huge Data, Often available via
  JSON, XML , RSS

Requires different type of DBs….
    Couch DB
    MongoDB
    Cassandra
    Hbase
    Neo4J
  Hadoop for Big Data Processing
CouchDB                 MongoDB

Data Model        Document Oriented       Document Oriented

Data Format       JSON                    BSON

Interface         REST                    TCP/IP

Query             MapReduce Java Script   Jmap Reduce ava Script +
                                          Query

Fault Tolerance   Master Master           Master Slave

Concurrency       MVCC (Versioning)       Updates in place

Performance       Comparatively lower     Higher
Dealing with Big Data


                 Cassandra         HBase
Type             Column DB         Colletcion- column DB

Type             Big Table         Big Table

Protocol         Binary (Thrift)   Binary (Thrift) HTTP/REST

Map Reduce       Via Hadoop        Via Hadoop
Disclaimer and Request
1. The presentation though quotes examples of my Company and products, the presentation is based on my
knowledge and experience and my company is not liable.

2. Attributed to most of the known source, if any attribution is missing, it is not due to intention but might not have
got the information of the original source or might be be negligence in my due diligence. It can be corrected if you
contact

3. Feel free to share some / all content however please attribute to Khanderao Kand

4. Social Media Networks mentioned in the presentation are more foe example but the approach is applicable to most
of all other social media and there is no intention to promote / discourage any media

5. User usage data and financial numbers are dated and would be stale / outdated over a period of time. You may
need to look for the latest data.

6. APIs , tools and libraries are third party and not from me / my company. Though they are listed based on my
experience and knowledge, use them at your risk.
7. We have products in Social Commerce, Social CRM, and recommendation. We also take projects around the space
and can be done outsource / jointly if interested in.

Contact : khanderao.kand@glomantra.com or khanderao@yahoo.com Twitter @khanderao

For original Slide deck (ppt) feel free to contact.
Q&A

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Facebook Python API
Introduction to Facebook Python APIIntroduction to Facebook Python API
Introduction to Facebook Python APIColin Su
 
Introduction To Open Web Protocols
Introduction To Open Web ProtocolsIntroduction To Open Web Protocols
Introduction To Open Web ProtocolsMohan Krishnan
 
Facebook Python SDK - Introduction
Facebook Python SDK - IntroductionFacebook Python SDK - Introduction
Facebook Python SDK - IntroductionColin Su
 
Building AJAX Applications Using Yahoo! Web Services
Building AJAX Applications Using Yahoo! Web ServicesBuilding AJAX Applications Using Yahoo! Web Services
Building AJAX Applications Using Yahoo! Web Servicesgoodfriday
 
Designing for Developers
Designing for DevelopersDesigning for Developers
Designing for DevelopersMicah Laaker
 
Exposing the Web’s Biggest (Free) Billboard
Exposing the Web’s Biggest (Free) BillboardExposing the Web’s Biggest (Free) Billboard
Exposing the Web’s Biggest (Free) BillboardMicah Laaker
 
Facebook Open Graph Overview
Facebook Open Graph OverviewFacebook Open Graph Overview
Facebook Open Graph OverviewCory OBrien
 
What's New on the Facebook Platform, January 2012
What's New on the Facebook Platform, January 2012What's New on the Facebook Platform, January 2012
What's New on the Facebook Platform, January 2012Iskandar Najmuddin
 
What's New on the Facebook Platform, March 2012
What's New on the Facebook Platform, March 2012What's New on the Facebook Platform, March 2012
What's New on the Facebook Platform, March 2012Iskandar Najmuddin
 
What's New on The Facebook Platform, October 2011
What's New on The Facebook Platform, October 2011What's New on The Facebook Platform, October 2011
What's New on The Facebook Platform, October 2011Iskandar Najmuddin
 
Intro to SharePoint's Social APIs - SharePoint Sat NYC 2013
Intro to SharePoint's Social APIs - SharePoint Sat NYC 2013Intro to SharePoint's Social APIs - SharePoint Sat NYC 2013
Intro to SharePoint's Social APIs - SharePoint Sat NYC 2013Michael Oryszak
 
Presentazione del blog "2020: a bot odyssey"
Presentazione del blog "2020: a bot odyssey"Presentazione del blog "2020: a bot odyssey"
Presentazione del blog "2020: a bot odyssey"RobertoCrotti8
 

Was ist angesagt? (13)

Introduction to Facebook Python API
Introduction to Facebook Python APIIntroduction to Facebook Python API
Introduction to Facebook Python API
 
Introduction To Open Web Protocols
Introduction To Open Web ProtocolsIntroduction To Open Web Protocols
Introduction To Open Web Protocols
 
Facebook Python SDK - Introduction
Facebook Python SDK - IntroductionFacebook Python SDK - Introduction
Facebook Python SDK - Introduction
 
Building AJAX Applications Using Yahoo! Web Services
Building AJAX Applications Using Yahoo! Web ServicesBuilding AJAX Applications Using Yahoo! Web Services
Building AJAX Applications Using Yahoo! Web Services
 
Designing for Developers
Designing for DevelopersDesigning for Developers
Designing for Developers
 
Exposing the Web’s Biggest (Free) Billboard
Exposing the Web’s Biggest (Free) BillboardExposing the Web’s Biggest (Free) Billboard
Exposing the Web’s Biggest (Free) Billboard
 
Facebook Open Graph Overview
Facebook Open Graph OverviewFacebook Open Graph Overview
Facebook Open Graph Overview
 
What's New on the Facebook Platform, January 2012
What's New on the Facebook Platform, January 2012What's New on the Facebook Platform, January 2012
What's New on the Facebook Platform, January 2012
 
Introducing Facebook
Introducing FacebookIntroducing Facebook
Introducing Facebook
 
What's New on the Facebook Platform, March 2012
What's New on the Facebook Platform, March 2012What's New on the Facebook Platform, March 2012
What's New on the Facebook Platform, March 2012
 
What's New on The Facebook Platform, October 2011
What's New on The Facebook Platform, October 2011What's New on The Facebook Platform, October 2011
What's New on The Facebook Platform, October 2011
 
Intro to SharePoint's Social APIs - SharePoint Sat NYC 2013
Intro to SharePoint's Social APIs - SharePoint Sat NYC 2013Intro to SharePoint's Social APIs - SharePoint Sat NYC 2013
Intro to SharePoint's Social APIs - SharePoint Sat NYC 2013
 
Presentazione del blog "2020: a bot odyssey"
Presentazione del blog "2020: a bot odyssey"Presentazione del blog "2020: a bot odyssey"
Presentazione del blog "2020: a bot odyssey"
 

Andere mochten auch

Social media apps jax-london-feb2012
Social media apps jax-london-feb2012Social media apps jax-london-feb2012
Social media apps jax-london-feb2012Khanderao Kand
 
Power starter guide for yoga
Power starter guide for yogaPower starter guide for yoga
Power starter guide for yogaLee Albins
 
Taxation of E-Commerce
Taxation of E-CommerceTaxation of E-Commerce
Taxation of E-Commercedbaldin3
 
Certificate of honour for inspirational mentorship
Certificate of honour for inspirational mentorshipCertificate of honour for inspirational mentorship
Certificate of honour for inspirational mentorshipneotc
 
2014 NC-ACTE Fall Forum CAEP Meta-Evidence Presentation
2014 NC-ACTE Fall Forum CAEP Meta-Evidence Presentation 2014 NC-ACTE Fall Forum CAEP Meta-Evidence Presentation
2014 NC-ACTE Fall Forum CAEP Meta-Evidence Presentation Erin Thomas Horne
 
Big dataarchitecturesandecosystem+nosql
Big dataarchitecturesandecosystem+nosqlBig dataarchitecturesandecosystem+nosql
Big dataarchitecturesandecosystem+nosqlKhanderao Kand
 

Andere mochten auch (8)

Social media apps jax-london-feb2012
Social media apps jax-london-feb2012Social media apps jax-london-feb2012
Social media apps jax-london-feb2012
 
Power starter guide for yoga
Power starter guide for yogaPower starter guide for yoga
Power starter guide for yoga
 
PLM_for_New_Normal_KK_Pres_May15
PLM_for_New_Normal_KK_Pres_May15PLM_for_New_Normal_KK_Pres_May15
PLM_for_New_Normal_KK_Pres_May15
 
Taxation of E-Commerce
Taxation of E-CommerceTaxation of E-Commerce
Taxation of E-Commerce
 
Certificate of honour for inspirational mentorship
Certificate of honour for inspirational mentorshipCertificate of honour for inspirational mentorship
Certificate of honour for inspirational mentorship
 
2014 NC-ACTE Fall Forum CAEP Meta-Evidence Presentation
2014 NC-ACTE Fall Forum CAEP Meta-Evidence Presentation 2014 NC-ACTE Fall Forum CAEP Meta-Evidence Presentation
2014 NC-ACTE Fall Forum CAEP Meta-Evidence Presentation
 
Banner dodge
Banner dodgeBanner dodge
Banner dodge
 
Big dataarchitecturesandecosystem+nosql
Big dataarchitecturesandecosystem+nosqlBig dataarchitecturesandecosystem+nosql
Big dataarchitecturesandecosystem+nosql
 

Ähnlich wie Social mediaprogramming part2-java-jax-london

Barcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentBarcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentHoat Le
 
A .net developer experiences with web2.0 and social media
A .net developer experiences with web2.0 and social mediaA .net developer experiences with web2.0 and social media
A .net developer experiences with web2.0 and social mediaRoy Lachica
 
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
 
RockYou at Girls in Tech Developer Forum
RockYou at Girls in Tech Developer ForumRockYou at Girls in Tech Developer Forum
RockYou at Girls in Tech Developer Forumthemix
 
Confessions of-a-gadget-holic
Confessions of-a-gadget-holicConfessions of-a-gadget-holic
Confessions of-a-gadget-holicTyrell Perera
 
Yahoo! Open Strategy (Y!OS) and Government
Yahoo! Open Strategy (Y!OS) and GovernmentYahoo! Open Strategy (Y!OS) and Government
Yahoo! Open Strategy (Y!OS) and GovernmentCody Simms
 
What Is Google Wave?
What Is Google Wave?What Is Google Wave?
What Is Google Wave?Mark Fidelman
 
Social Developers London - Facebook F8 and Twitter Developer comparison
Social Developers London - Facebook F8 and Twitter Developer comparisonSocial Developers London - Facebook F8 and Twitter Developer comparison
Social Developers London - Facebook F8 and Twitter Developer comparisonAngus Fox
 
Intuitive APIs and Developer Education
Intuitive APIs and Developer EducationIntuitive APIs and Developer Education
Intuitive APIs and Developer EducationPostman
 
Using Social Network Tools for Your Business
Using Social Network Tools for Your BusinessUsing Social Network Tools for Your Business
Using Social Network Tools for Your BusinessRBearSAT
 
Mobile, Social, Global: Applications of Emerging Technologies in Survey Reseach
Mobile, Social, Global: Applications of Emerging Technologies in Survey ReseachMobile, Social, Global: Applications of Emerging Technologies in Survey Reseach
Mobile, Social, Global: Applications of Emerging Technologies in Survey ReseachAdamSage
 
Web 2.0 - Open Source Perspective
Web 2.0 - Open Source PerspectiveWeb 2.0 - Open Source Perspective
Web 2.0 - Open Source PerspectiveGautam Kishore
 
Resources (Links) for 2016
Resources (Links) for 2016Resources (Links) for 2016
Resources (Links) for 2016Andrew Newman
 

Ähnlich wie Social mediaprogramming part2-java-jax-london (20)

Barcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentBarcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application Development
 
Update08 Web2
Update08 Web2Update08 Web2
Update08 Web2
 
Hi5 Open Social
Hi5   Open SocialHi5   Open Social
Hi5 Open Social
 
A .net developer experiences with web2.0 and social media
A .net developer experiences with web2.0 and social mediaA .net developer experiences with web2.0 and social media
A .net developer experiences with web2.0 and social media
 
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
 
Ir11 bodle final
Ir11 bodle finalIr11 bodle final
Ir11 bodle final
 
RockYou at Girls in Tech Developer Forum
RockYou at Girls in Tech Developer ForumRockYou at Girls in Tech Developer Forum
RockYou at Girls in Tech Developer Forum
 
Confessions of-a-gadget-holic
Confessions of-a-gadget-holicConfessions of-a-gadget-holic
Confessions of-a-gadget-holic
 
Yahoo! Open Strategy (Y!OS) and Government
Yahoo! Open Strategy (Y!OS) and GovernmentYahoo! Open Strategy (Y!OS) and Government
Yahoo! Open Strategy (Y!OS) and Government
 
Yahoo Open Platform Stack
Yahoo Open Platform StackYahoo Open Platform Stack
Yahoo Open Platform Stack
 
What Is Google Wave?
What Is Google Wave?What Is Google Wave?
What Is Google Wave?
 
Web2.0 : an introduction
Web2.0 : an introductionWeb2.0 : an introduction
Web2.0 : an introduction
 
OpalVera Presentation 1
OpalVera Presentation 1OpalVera Presentation 1
OpalVera Presentation 1
 
Social Developers London - Facebook F8 and Twitter Developer comparison
Social Developers London - Facebook F8 and Twitter Developer comparisonSocial Developers London - Facebook F8 and Twitter Developer comparison
Social Developers London - Facebook F8 and Twitter Developer comparison
 
Intuitive APIs and Developer Education
Intuitive APIs and Developer EducationIntuitive APIs and Developer Education
Intuitive APIs and Developer Education
 
Using Social Network Tools for Your Business
Using Social Network Tools for Your BusinessUsing Social Network Tools for Your Business
Using Social Network Tools for Your Business
 
Mobile, Social, Global: Applications of Emerging Technologies in Survey Reseach
Mobile, Social, Global: Applications of Emerging Technologies in Survey ReseachMobile, Social, Global: Applications of Emerging Technologies in Survey Reseach
Mobile, Social, Global: Applications of Emerging Technologies in Survey Reseach
 
Web 2.0 - Open Source Perspective
Web 2.0 - Open Source PerspectiveWeb 2.0 - Open Source Perspective
Web 2.0 - Open Source Perspective
 
OpenSocial
OpenSocialOpenSocial
OpenSocial
 
Resources (Links) for 2016
Resources (Links) for 2016Resources (Links) for 2016
Resources (Links) for 2016
 

Social mediaprogramming part2-java-jax-london

  • 1. Social Media Programming Khanderao Kand CTO GloMantra Inc mybantu virtual personalized Assistance @khanderao Nov 2, 2011 at JAX Conference, London
  • 2. Khanderao Kand CTO of Glomantra and myBantu in Silicon Valley, CA, USA AI based Relevance platform / recommendation technology with Social Intelligence Projects on Big Data, Computing, Machine Learning, Text Analytics, SOA, User Interest profiling, Yield Optimization BIO: 20 years in Industry (currently AI, SOA, Social, Mobile and Cloud Technologies) Lead Oracle’s SOA and BPM Architecture Chief Consulting Architect for SOA and BPM to 50+ architects & hundreds of developers of Oracle’s next Generation Fusion Apps Lead Architect of Peopletools Architect in CRM, Online Dialog Marketing, OLAP Hyperion Participated in Standards of BPEL and SCA at OASIS 9 Patents filled Frequent Speaker in conferences Authored articles in JDJ, WSJ, Cloud Computing
  • 3. Agenda APIs, Frameworks and Tools for Social Computing: Key Technologies, APIs Interfacing with Popular Social media Storage Social Media Data Processing
  • 5. OAuth OAuth is open standard for Authorizing Access (typically data access / actions) Oauth hands over access token and not user credentials Oauth is essential to developing social-ready applications OAuth protocol (Dance) involves series of 3 party (consumer browser, Service provider – Social media Site and App). OAuth, including Twitter, Facebook, LinkedIn, TripIt, and Foursquare, as well as the Google and Yahoo APIs. Different SM supports either Oauth 1.0 and Oauth 2.0 Visit : http://oauth.net APIs: Jersery (JAX-RS), Spring Security API, Googlecode,
  • 6.
  • 7. Open ID Open ID is open source standard for multi-site authentication OpenId is for authentication as against Oauth No need of adhoc and site specific authentication Oauth and OpenID can coexist Open ID providers : think of Google login Providers pass ID attributes to the relying party (app) However, Oauth is more popular and common in Social Media interfaces Visit http://www.openid.org Java API: openid4java, GAE supports,
  • 8. REST Representational State Transfer (Roy Fielding’s paper for Architectural Style over HTTP) Basic GET, PUT, POST, DELETE operations on a resource Internet world REST is currently winning Google, Yahoo, Facebook, etc etc. Java: Jersey (JAX-RS), Restlet, RestFul Services, JAX-WS
  • 9. JSON Javascript Simple Object Notation as lightweight data interchange format Lighter than XML Can be manipulated on browsers No need for parsing into DOM http://www.json.org Java API: GSON, Jackson, JSONLib, FlexJSON XML to/from JSON conversion: JSONLib
  • 10. RSS Really Simple Syndication (originally RDF Site Summary) Started with news, site, blogs update Simple and lightweight Popular Readers: Google Reader, Feedly etc Java API: ROME, Simple XML parsing
  • 11. APIs of Popular Social Media
  • 12. Facebook Graph API Representing objects and relationships in Facebook’s social network Simple, consistent and REST style representation Objects: People, events, pages, and photos People: http://graph.facebook.com/659690992/picture Events: http://graph.facebook.com/331218348435/picture Groups: http://graph.facebook.com/69048030774/picture Pages: http://graph.facebook.com/DoloresPark/picture Applications: http://graph.facebook.com/2318966938/picture Photo Albums: http://graph.facebook.com/platform/picture Access API: https://graph.facebook.com/ID/CONNECTION_TYPE
  • 13. Facebook Graph API: Access https://graph.facebook.com/ID/CONNECTION_TYPE Friends: https://graph.facebook.com/me/friends?access_token=... News feed: https://graph.facebook.com/me/home?access_token=... Profile feed (Wall): https://graph.facebook.com/me/feed?access_token=... Likes: https://graph.facebook.com/me/likes?access_token=... Movies: https://graph.facebook.com/me/movies?access_token=... Music: https://graph.facebook.com/me/music?access_token=... Books: https://graph.facebook.com/me/books?access_token=... Notes: https://graph.facebook.com/me/notes?access_token=... Permissions: https://graph.facebook.com/me/permissions?access_token=... Photo Tags: https://graph.facebook.com/me/photos?access_token=... Photo Albums: https://graph.facebook.com/me/albums?access_token=... Video Tags: https://graph.facebook.com/me/videos?access_token=... Video Uploads: https://graph.facebook.com/me/videos/uploaded?access_token=... Events: https://graph.facebook.com/me/events?access_token=... Groups: https://graph.facebook.com/me/groups?access_token=... Checkins: https://graph.facebook.com/me/checkins?access_token=…
  • 14. Facebook Search using Graph API All public objects https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE All public posts: https://graph.facebook.com/search?q=socialcommerce&type=post People: https://graph.facebook.com/search?q=Khanderao&type=user Pages: https://graph.facebook.com/search?q=glomantra&type=page Events: https://graph.facebook.com/search?q=conference&type=event Groups: https://graph.facebook.com/search?q=programming&type=group Places: https://graph.facebook.com/search?q=coffee&type=place&center=37.76,122.42 7&distance=1000 Checkins: https://graph.facebook.com/search?type=checkin
  • 15. Facebook: Publishing on Wall HTTP Post Access token curl -F 'access_token=...' https://graph.facebook.com/313449204401/likes
  • 16. Example String url = "https://graph.facebook.com/"+facebook ID+"/feed"; String data = URLEncoder.encode("access_token", "UTF-8") + "=" + URLEncoder.encode(“ACCESS TOKEN STRING”, "UTF-8"); data += "&" + URLEncoder.encode("message", "UTF-8") + "=" + URLEncoder.encode(“wallMessageText”, "UTF-8"); data += "&" + URLEncoder.encode("picture", "UTF-8") + "=" + URLEncoder.encode(”IMAGE URL”, "UTF-8"); data += "&" + URLEncoder.encode("name", "UTF-8") + "=" + URLEncoder.encode(“POST TITLE STRING”, "UTF-8"); data += "&" + URLEncoder.encode("caption", "UTF-8") + "=" + URLEncoder.encode(“CAPTION STRING”, "UTF-8"); data += "&" + URLEncoder.encode("description", "UTF-8") + "=" + URLEncoder.encode(“DESCRIPTION”, "UTF-8"); data += "&" + URLEncoder.encode("actions", "UTF-8") + "=" + URLEncoder.encode("{"name": ”action_name", "link": ” http://192.169.0.46/app/valid url1"}", "UTF-8"); data += "&" + URLEncoder.encode("link", "UTF-8") + "=" + URLEncoder.encode(“LINK URL”, "UTF-8"); // Constructing action links JSONObject obj = new JSONObject(); LinkedHashMap<String, Object> m1 = new LinkedHashMap<String, Object>(); m1.put("text“,”LINK1 TEXT”); m1.put("href", “http://192.169.0.46/app/valid action url1”); obj.put(”LINK1 LABEL”, m1);
  • 17. Twitter Twitter is ranked as one of the ten-most-visited websites worldwide by Alexa's web traffic analysis. March 2010 10 billionth tweet Twitter has a user retention rate of forty percent. Value: Conversational 30%, Pointless Babble 30%, Promotion 8%, News 8%, news 7-8% and spam Good source: news validation, trend, topic updates
  • 18. Twitter Usage "Twitter Revolutions" and which include the 2011 Egyptian revolution, 2010–2011 Tunisian protests, 2009–2010 Iranian election protests, and 2009 Moldova civil unrest Twitter is also increasingly used for making TV more interactive and social Most of the celebrities are on Twitter President Obama and many others effectively used Twitter for campaigning Twitter has become a great source for latest news Twitter is an indicator for buzz around latest topics and trends Brands are using twitters for promotions of products and spreading deals
  • 19. 3rd party Twitter Java APIs Twitter4J : Open Source BSD Java-Twitter Jtwitter : Open Source Twitter Client Streaming API
  • 20. Twitter Twitter API allows to Tweet Direct message Search Get tweets
  • 21. Twitter4J API Twitter4J (third party – open source) Access token / consumer key in twitter.properties Twitter twitter = new TwitterFactory().getInstance(); Query query = new Query(”mybantu"); QueryResult result = twitter.search(query); // uodate status Status status = twitter.updateStatus(latestStatus);
  • 22. Twitter Fire hose GNIP 50% at approximately 360K per year For analysis but not for resale or display tweets Spritzer 2% random for free
  • 23. Open Social Project "For the question about Google plans to allow developers to create Google+ apps deploying the OpenSocial APIs, a spokeswoman of Google said that by means of email nowadays the Google+ platform can’t support the OpenSocial APIs. She also added that nevertheless, they are utilizing many of the technology which was designed as part of OpenSocial, along with the gadget application packaging model, and power Google+ games and the Portable Contacts JSON schema. Because they define the +Platform APIs, they are drawing close attention to the future tendency of the OpenSocial APIs, as well as converging everything possible."
  • 24. Developing Social Network Apache Opensource project in incubation Shindig
  • 25. Open Social Great initiative with huge promise A common “open source” API for social media launched in 2007 Early movers as open social containers: Google Orkut, hi5, LinkedIn, MySpace, Netlog, Ning, orkut, and Yahoo! Opensource OpenSocial Based container : Apache Shindig Bummer… Except Facebook Google+ is not yet committed to Open Social
  • 26. Google Social Graph API By supporting open Web standards for describing connections between people, web sites can add to the social infrastructure of the web The API returns web addresses of public pages and publicly declared connections between them. Allows developers to create a button for a Web site that would allow a registered user to easily "add friends.” index the public Web for Friends of A Friend (FOAF) and Friends Network
  • 27. Google’s Public Social Graph The Social Graph API looks for two types of publicly declared connections: 1. It looks for all public URLs that belong to you and are interconnected. This could be your blog (a1), your LiveJournal page (a2), and your Twitter account (a3). 2. It looks for publicly declared connections between people. For example, a1 may link to b's blog while a1 and c link to each other.
  • 28. Google+ API https://developers.google.com/+/api/ Searching Public posts GET https://www.googleapis.com/plus/v1/activities?query=cookie%20recipes &orderBy=best&key=[yourAPIKey] People Search GET https://www.googleapis.com/plus/v1/people?query=Khanderao%20kand &key=[yourAPIKey] View People Interacting with Posts GET https://www.googleapis.com/plus/v1/activities/{activityId}/people/resha rers?key=[yourAPIKey] GET https://www.googleapis.com/plus/v1/activities/{activityId}/people/pluso ners?key=[yourAPIKey]
  • 29. Spring Social Spring Social provides templates for REST based API handling OAUth and providing operations specific to Social Media TwitterTemplate FacebookTemplate LinkedInTemplate TripItTemplate http://blog.springsource.com/2010/11/03/socializing-spring- applications/ http://greenhouse.springsource.org
  • 31. Social Media Data Often Needs Different Type of Database Social Media Contains: Huge Data, Often available via JSON, XML , RSS Requires different type of DBs…. Couch DB MongoDB Cassandra Hbase Neo4J Hadoop for Big Data Processing
  • 32. CouchDB MongoDB Data Model Document Oriented Document Oriented Data Format JSON BSON Interface REST TCP/IP Query MapReduce Java Script Jmap Reduce ava Script + Query Fault Tolerance Master Master Master Slave Concurrency MVCC (Versioning) Updates in place Performance Comparatively lower Higher
  • 33. Dealing with Big Data Cassandra HBase Type Column DB Colletcion- column DB Type Big Table Big Table Protocol Binary (Thrift) Binary (Thrift) HTTP/REST Map Reduce Via Hadoop Via Hadoop
  • 34. Disclaimer and Request 1. The presentation though quotes examples of my Company and products, the presentation is based on my knowledge and experience and my company is not liable. 2. Attributed to most of the known source, if any attribution is missing, it is not due to intention but might not have got the information of the original source or might be be negligence in my due diligence. It can be corrected if you contact 3. Feel free to share some / all content however please attribute to Khanderao Kand 4. Social Media Networks mentioned in the presentation are more foe example but the approach is applicable to most of all other social media and there is no intention to promote / discourage any media 5. User usage data and financial numbers are dated and would be stale / outdated over a period of time. You may need to look for the latest data. 6. APIs , tools and libraries are third party and not from me / my company. Though they are listed based on my experience and knowledge, use them at your risk. 7. We have products in Social Commerce, Social CRM, and recommendation. We also take projects around the space and can be done outsource / jointly if interested in. Contact : khanderao.kand@glomantra.com or khanderao@yahoo.com Twitter @khanderao For original Slide deck (ppt) feel free to contact.
  • 35. Q&A