social network application programming
TRANSCRIPT
Social Network Application Programming
Barcamp Stuttgart 2Katrin Mathis (@kanyma)
Katrin Mathis | 13.09.2009
Facebook> 250 Millionen aktive Benutzer
API seit Mai 2007> 1.000.000 Entwickler aus 180 Ländern> 350.000 aktive Anwendungen
2
Katrin Mathis | 13.09.2009
3
Katrin Mathis | 13.09.2009
4
Katrin Mathis | 13.09.2009
Facebook API: ScopeCanvasProfileFeedRequests
5
Katrin Mathis | 13.09.2009
Facebook API: API, FQL
ReSTRückgabeformate XML oder JSON
6
$friends = $facebook->api_client->friends_get();
$query = "SELECT first_name, last_name, pic FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = $user_id)";$results= $facebook->api_client->fql_query($query);
direkter Zugriff
Katrin Mathis | 13.09.2009
Facebook API: FBML
HTML und spezielle Facebook-TagsCustom Tagskomplette Funktionalität, z.B.
CSS mit Einschränkungen
7
echo "<fb:profile-pic uid=\"$friend\" /> <fb:name uid=\"$friend\" />";
<fb:board xid="1"></fb:board>
Katrin Mathis | 13.09.2009
Facebook API: FBJSgetters/setterseingeschränkte Nutzbarkeit LibrariesMock Ajax
Animation
8
<a clickrewriteurl='...' clickrewriteform='dummy_form' [...]
<a href="#" onclick="Animation(this).to('background', '#fff').from('background', '#ff0').go(); return false;">Flash</a>
Katrin Mathis | 13.09.2009
Facebook API: LinksDeveloper ApplicationClient LibrariesDeveloper WikiTest ConsoleForum
9
Katrin Mathis | 13.09.2009
OpenSocialca. 800 Millionen registrierte Nutzerca. 27 Live Container API seit November 20077.500 Anwendungen
10
Katrin Mathis | 13.09.2009
OpenSocial: Container
11
Katrin Mathis | 13.09.2009
OpenSocial: ContainerImplementierung und Bedingungen Sache der ContainerXRDS, um dynamisch zu ermitteln, was unterstützt wirdApplikation muss bei jedem Container angemeldet werden
12
Katrin Mathis | 13.09.2009
OpenSocial
13
Katrin Mathis | 13.09.2009
OpenSocial: 1. Client-side
14
<?xml version="1.0" encoding="UTF-8" ?><Module> <ModulePrefs title="Standard gadget structure"> <Require feature=”opensocial-0.8” /> <Require feature=”views” /> </ModulePrefs> <Content type="html" view=”profile”> <![CDATA[ This section contains the profile content ]]> </Content> <Content type="html" view=”canvas”> <![CDATA[ This section contains the canvas content ]]> </Content></Module>
XML StrukturJavaScript
function onLoadFriends(data) {
var viewer = data.get('viewer').getData(); [...]
Katrin Mathis | 13.09.2009
OpenSocial: 2. Server-sideLibrary in vielen Programmiersprachenentfernte Aufrufe mit RPC/REST
Rückgabe in JSON, AtomPub oder XMLAuthentifizierung über OAuth
15
gadgets.io.makeRequest(url, callback, opt_params)
Katrin Mathis | 13.09.2009
OpenSocialSeit Version 0.9 OSML
16
Welcome, <os:Name person="${Viewer}"/>
Katrin Mathis | 13.09.2009
OpenSocial: LinksOpenSocial ContainersGoogle Gadgets EditorClient LibrariesDeveloper WikiForum
17
Katrin Mathis | 13.09.2009
Facebook vs. OpenSocialProprietäre vs. offene StandardsOpenSocial mehr Netzwerke = mehr BenutzerOpen Social Apps weniger spezifisch,Facebook Apps tiefer integriert,mehr virale Effekte
18