Handwritten Text Recognition for manuscripts and early printed texts
Â
Virtual Tech Days 2010 - Integrating Social Networks with ASP.NET
1. virtual techdays
INDIA â 22-24 November 2010
Integrating Social Networks with ASP.NET
Krishna Chaitanya T â Future Web Research Lab, SETLabs, Infosys
WE SOCIALâ„
2. ï Overview of the social web
ï± Trends, Platforms and APIs
ï Enhancing websites with social experiences
ï± Facebook for websites
ï± Twitter widgets
ï Fun with Facebookâs Open Graph API
ï± App setup in FB platform
ï± jQuery + JavaScript SDK
ï The oAuth handshake flow
ï Implementing FB oAuth using C#
virtual techdays
S E S S I O N A G E N D A
INDIA â 22-24 November 2010 WE SOCIALâ„
3. ï Trends
ï± Web 1.0: Static, centralized, users read content, publishing rather than participation.
ï± Web 2.0: Dynamic, decentralized, AJAX, widgets, sharing, mashups, mobile, real time,
collective minds, interactive, location based
ï Platforms
ï± Facebook: Building social connections. Emphasizes profiles & people
ï± Twitter: Information network. Emphasizes content
ï± Foursquare: Location based social networking
ï± LinkedIn, MySpace, NetFlix, Flickr, Delicious, Digg etc
ï APIs
ï Every social network has its own REST based API, (mostly) sticking to open standards.
ï This session concentrates on: Facebook Graph API, Twitter API for ASP.NET sites.
virtual techdays
Overview of the social web
INDIA â 22-24 November 2010 WE SOCIALâ„
4. ï Websites can be made more social and interactive within minutes
ï Facebook social plugins for websites
ï± Extensions of facebook, very simple code
ï± Login button â login to your site with FB auth
ï± Like Button â share pages from your site to FB
ï± Others include: Comments, Activity Feed, Like Box, Face Pile, Live Stream
ï± Open Graph <meta> tags make your page equivalent to FB page
ï Twitter Everywhere/widgets
ï± Twitter updates on your website
ï± Search Widget â display real time tweets for live events
ï± Facebook-Twitter Integration app
ï For more control & customization, we need to play with core APIs.
virtual techdays
Enhancing websites with social experiences
INDIA â 22-24 November 2010 WE SOCIALâ„
5. ï Rest based API, unique ID per object, JSON response. Public data queries:
ï± Object for VTD FB page: http://graph.facebook.com/49570201848
ï± Object for Microsoft PDC FB page: http://graph.facebook.com/MicrosoftPDC
ï± Meta data: http://graph.facebook.com/MicrosoftPDC?metadata=1
ï For querying private data, access token is required via FB authorization
ï± PDC Statuses: http://graph.facebook.com/microsoftpdc/statuses?accesstoken=âtokenâ
ï To use graph API with JavaScript SDK:
ï you need to register an FB app and get application ID (app Id)
ï Use the App Id in FB JavaScript API. jQuery suits perfect for AJAX & other cool stuff.
virtual techdays
Fun with Facebookâs Open Graph API
INDIA â 22-24 November 2010 WE SOCIALâ„
7. ï Most social n/w use oAuth protocol for authorization. [oAuth=âno passwords pleaseâ]
ï FB JavaScript SDK simplifies login/signup without worrying about oAuth protocol.
ï To get FB âaccess tokenâ programmatically, oAuth flow should be understood. Here are the
steps of oAuth flow:
1. Redirect to
https://graph.facebook.com/oauth/authorize? client_id=...&
redirect_uri=http://www.example.com/oauth_redirect
2. User authorizes-> FB redirects to âredirect_uriâ with the parameter âcodeâ
3. Extract the âcodeâ & redirect to:
https://graph.facebook.com/oauth/access_token? client_id=...&
redirect_uri=http://www.example.com/oauth_redirect& client_secret=...& code=...
4. From the above request, Facebook returns âaccess_tokenâ. Use this to make authorized requests like :
https://graph.facebook.com/me?access_token=...
virtual techdays Querying private dataâŠ
INDIA â 22-24 November 2010 WE SOCIALâ„
8. virtual techdays oAuth handshake Flow Diagram
[Note: This is a generic oAuth flow diagram applicable to all social network APIs.]
INDIA â 22-24 November 2010 WE SOCIALâ„