586
edits
| (12 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
=API – Application Programming Interface= | =API – Application Programming Interface= | ||
[http://www.slideshare.net/augentier/api-vortrag Präsentation auf slideshare.net] | |||
==Übersicht== | ==Übersicht== | ||
* Facebook – Graph API | * Facebook – Graph API | ||
| Line 5: | Line 6: | ||
* YouTube – Data API | * YouTube – Data API | ||
==[[JSON]]== | ==[[JSON]]== | ||
===Struktur | ===Struktur von JSON=== | ||
<source lang="javascript" > | <source lang="javascript" > | ||
{ | { | ||
| Line 19: | Line 20: | ||
} | } | ||
</source> | </source> | ||
'' | ''Size: 169 Bytes'' | ||
===Vergleich zu XML=== | ===Vergleich zu XML=== | ||
<source lang="xml"> | <source lang="xml"> | ||
| Line 34: | Line 36: | ||
</object> | </object> | ||
</source> | </source> | ||
'' | ''Size: 226 Bytes'' | ||
===Vorteile gegenüber XML=== | |||
Kleinere Datei, verschiedene Daten-Typen (string, number, object, array, boolean, empty), einfaches Parsing in JavaScript, PHP, Objective-C usw. | |||
==Parsing JSON== | ==Parsing JSON== | ||
===jQuery=== | ===jQuery=== | ||
| Line 76: | Line 79: | ||
} | } | ||
</source> | </source> | ||
'' | ''Size: 1.16 KB'' | ||
===Albums=== | ===Albums=== | ||
[http://graph.facebook.com/mercedesbenzdeutschland/albums graph.facebook.com/mercedesbenzdeutschland/albums] | [http://graph.facebook.com/mercedesbenzdeutschland/albums graph.facebook.com/mercedesbenzdeutschland/albums] | ||
| Line 120: | Line 123: | ||
} | } | ||
</source> | </source> | ||
'' | ''Size: 1.16 KB'' | ||
===Album Photos=== | ===Album Photos=== | ||
| Line 154: | Line 157: | ||
"height": 505, | "height": 505, | ||
"width": 720, | "width": 720, | ||
"source": "http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/ | "source": "http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/299511_2510922149…" | ||
}, | }, | ||
{ | { | ||
"height": 126, | "height": 126, | ||
"width": 180, | "width": 180, | ||
"source": "http://photos-f.ak.fbcdn.net/hphotos-ak-snc7/ | "source": "http://photos-f.ak.fbcdn.net/hphotos-ak-snc7/299511_251092214938743_14568965…" | ||
}, | }, | ||
[…] | […] | ||
| Line 208: | Line 211: | ||
===Reference=== | ===Reference=== | ||
[http://developers.facebook.com/docs/reference/api/ developers.facebook.com/docs/reference/api/] | [http://developers.facebook.com/docs/reference/api/ developers.facebook.com/docs/reference/api/] | ||
===Example=== | |||
[[File:Example_facebook_api.zip|Download Example]] | |||
==Twitter== | ==Twitter== | ||
[http://api.twitter.com/1/statuses/user_timeline.json?screen_name=saschalobo api.twitter.com/1/statuses/user_timeline.json?screen_name=saschalobo] | [http://api.twitter.com/1/statuses/user_timeline.json?screen_name=saschalobo api.twitter.com/1/statuses/user_timeline.json?screen_name=saschalobo] | ||
| Line 273: | Line 279: | ||
===Reference=== | ===Reference=== | ||
[http://code.google.com/intl/en-UK/apis/youtube/2.0/reference.html code.google.com/intl/en-UK/apis/youtube/2.0/reference.html] | [http://code.google.com/intl/en-UK/apis/youtube/2.0/reference.html code.google.com/intl/en-UK/apis/youtube/2.0/reference.html] | ||
===Example=== | |||
[[File:Example_youtube_api.zip|Download Example]] | |||
edits