Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Próximo SlideShare
CSS3 ...in 3D!
CSS3 ...in 3D!
Cargando en…3
×

Eche un vistazo a continuación

1 de 19 Anuncio

Más Contenido Relacionado

Presentaciones para usted (18)

A los espectadores también les gustó (18)

Anuncio

Similares a Api vortrag (20)

Más reciente (20)

Anuncio

Api vortrag

  1. 1. API Application Programming Interface
  2. 2. Übersicht • Facebook – Graph API • Twitter – REST API • YouTube – Data API
  3. 3. JSON { <object> "key": "vaule", ! <key>vaule</key> "string": "Lorem ipsum dolor sit", ! <string>Lorem ipsum dolor sit</string> "number": -123.456, ! <number>-123.456</number> "object":{ ! <object> ! "key": "value" ! ! <key>value</key> }, ! </object> "array": ["foo","bar"], ! <array>foo</array><array>bar</array> "boolean": true, ! <bolean>true</bolean> "empty": null ! <empty>null</empty> } </object> 169 Bytes 226 Bytes Eine mögliche XML-Schreibweise, andere Schreibweisen sind möglich.
  4. 4. Parsing JSON jQuery PHP $.ajax({ $url = "example.json"; ! url: "example.json", $file_content = file_get_contents($url); ! success: function(data){ $data = json_decode($file_content); ! ! alert(data.string); echo $data->string; ! } });
  5. 5. Facebook graph.facebook.com/cocacola { "id": "40796308305", "name": "Coca-Cola", "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/276879_40796308305_1578420141_s.jpg", "link": "https://www.facebook.com/coca-cola", "likes": 35648837, "category": "Food/beverages", "website": "http://www.coca-cola.com", "username": "coca-cola", "founded": "1886", "products": "Coca-Cola is the most popular and biggest-selling soft drink in history […]", "location":{ "latitude": 42.00736, "longitude": -72.521224 }, "can_post": true, "checkins": 73 } Dateigröße: 1,16 KB
  6. 6. Facebook – Albums graph.facebook.com/mercedesbenzdeutschland/albums { "data": [ { "id": "251092158272082", "from": { "name": "Mercedes-Benz Deutschland", "category": "Cars", "id": "145689658812333" }, "name": "DTM 2011 - Rennen, Finale und Showprogramm", "location": "Hockenheimring Baden-Wu00fcrttemberg", "link": "https://www.facebook.com/album.php?fbid=251092158272082&id=145689658812333&aid=54543", "cover_photo": "251092214938743", "count": 10, "type": "normal", "created_time": "2011-10-27T08:08:23+0000", "updated_time": "2011-10-27T08:10:30+0000", "can_upload": false }, { "id": "249480695099895", "from": { "name": "Mercedes-Benz Deutschland",
  7. 7. Facebook – Album Photos graph.facebook.com/251092158272082/photos { "data": [ { "id": "251092214938743", "from": { "name": "Mercedes-Benz Deutschland", "category": "Cars", "id": "145689658812333" }, "tags": { "data": [ { "id": "100000441323195", "name": "Denis Hu00f6rner", "x": 50.1042, "y": 83.6795, "created_time": "2011-10-27T10:40:08+0000" } ] }, "name": "DTM 2011rnrnMotorsports / DTM: german touring cars championship 2011, 07 […]", "picture": "http://photos-f.ak.fbcdn.net/hphotos-ak-snc7/299511_251092214938743_145689658812333_64…", "source": "http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/299511_251092214938743_14568965…",
  8. 8. Facebook – Picture graph.facebook.com/251092214938743 { "id": "251092214938743", "from": { "name": "Mercedes-Benz Deutschland", "category": "Cars", "id": "145689658812333" }, "tags": { ! ! […] }, "name": "DTM 2011rnrnMotorsports / DTM: german touring cars championship 2011, 07 Jamie Green (GBR, AMG "picture": "http://photos-f.ak.fbcdn.net/hphotos-ak-snc7/299511_251092214938743_145689658812333_642955_10555 "source": "http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/299511_251092214938743_145689658812333_64 "height": 505, "width": 720, "images": [ { "height": 505, "width": 720, "source": "http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/299511_251092214938743_145689658812 }, { "height": 126,
  9. 9. Facebook – Graph API developers.facebook.com/docs/reference/api/
  10. 10. Facebook – Authentication developers.facebook.com/docs/authentication/
  11. 11. Facebook – Beispiel
  12. 12. Twitter api.twitter.com/1/statuses/user_timeline.json?screen_name=saschalobo [ ! { ! ! "id": 134979869225402368, ! ! "text": "Keine Ahnung, was das fu00fcr die Finanzkrise hiesse, aber mein Leben wu00e4re besser, wenn der Begriff "Rating-Riese" verboten wu00fcrde", ! ! "created_at": "Fri Nov 11 13:04:43 +0000 2011", ! ! "user": { ! ! ! "id": 5876652, ! ! ! "name": "Sascha Lobo", ! ! ! "screen_name": "saschalobo" ! ! }, ! ! "retweet_count": 9 ! }, ! { ! ! "id": 134944048069869569, ! ! "text": "u00dcberall liest man 11.11.11 u2013u00a0liebe Nerds, bitte achtet auch im Internet auf Eure Schriftsprache und schreibt: !!.!!.!!", ! ! "created_at": "Thu Nov 10 22:31:56 +0000 2011", ! ! "user": { ! ! ! "id": 5876652, ! ! ! "name": "Sascha Lobo", ! ! ! "screen_name": "saschalobo" ! ! },
  13. 13. Twitter – REST API dev.twitter.com/docs/api
  14. 14. Twitter – Beispiel Berlintwitterwall
  15. 15. YouTube gdata.youtube.com/feeds/api/users/NationalGeographic/uploads?v=2&alt=json&max-results=50 { ! […] ! "entry": [ ! ! { ! ! ! "published": { ! ! ! ! "$t": "2011-11-11T20:59:35.000Z" ! ! ! }, ! ! ! "updated": { ! ! ! ! "$t": "2011-11-13T18:00:48.000Z" ! ! ! }, ! ! ! "title": { ! ! ! ! "$t": "Thrive: How to be Happy Tip #1" ! ! ! }, ! ! ! "media$group": { ! ! ! ! "media$thumbnail": [ ! ! ! ! ! { ! ! ! ! ! ! "url": "http://i.ytimg.com/vi/gYm0tDcQMI0/default.jpg", ! ! ! ! ! ! "time": "00:00:37.500" ! ! ! ! ! }, ! ! ! ! ! { ! ! ! ! ! ! "url": "http://i.ytimg.com/vi/gYm0tDcQMI0/3.jpg", ! ! ! ! ! ! "time": "00:00:56.250" ! ! ! ! ! }
  16. 16. YouTube – Data API code.google.com/intl/en-UK/apis/youtube/2.0/reference.html
  17. 17. YouTube – Beispiel
  18. 18. Pipes pipes.yahoo.com
  19. 19. Anwendungen • Mediatheken Videos von YouTube & Fotos von Facebook verbinden • Benutzergenerierte Inhalte Twitterwall, Benutzerbilder von Partygästen

×