1 / 34

Proseminar Web Engineering PS07: Retrieving data from social networks: APIs and protocols

Proseminar Web Engineering PS07: Retrieving data from social networks: APIs and protocols. Wir wollen Daten aus. sozialen Netzwerken. Quelle: http://www.flickr.co m/photos/theplanetdotcom/4878805271. Wir brauchen Schnittstellen.

vadin
Download Presentation

Proseminar Web Engineering PS07: Retrieving data from social networks: APIs and protocols

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Proseminar Web EngineeringPS07: Retrieving data fromsocial networks: APIs and protocols

  2. Wir wollen Daten aus sozialen Netzwerken. Quelle: http://www.flickr.com/photos/theplanetdotcom/4878805271

  3. Wir brauchen Schnittstellen. Quelle: http://www.flickr.com/photos/78317189@N00/2106395842

  4. APIs (1993) "Applicationprograminterface„ "Schnittstelle für Anwendungsprogramme". Die Nutzung von APIs erlaubt es Softwareentwicklern, Anwendungen zu schreiben und dabei bereits vorhandene, standardisierte Bibliotheksroutinen zu nutzen. Quelle: http://lexikon.martinvogel.de/api.html

  5. Quelle: http://www.dastimmtdochwasnicht.de/MyUploads/071221_Ziehen.jpg APIs sind Designprobleme

  6. SOAP REST vs

  7. Seife? Simple Object Access Protocol Quelle: http://www.flickr.com/photos/annia316/4492308897

  8. SOAP • Protokoll mit Regeln für Nachrichtendesign • Konvention für entfernte Prozeduraufrufe • Nutzt Netzwerkprotokolle auf Transport- und Anwendungsschicht (HTTP(S), SMTP) • Nutzt XML zur Repräsentation • Unterstützung von z.B. IBM, Microsoft

  9. SOAP – Aufbau Request <?xmlversion="1.0"?> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Header> </s:Header> <s:Body> <m:UserInDatabasexmlns:m="http://www.socialnetwork-db.de/soap"> meinUsername </m:UserInDatabase> </s:Body> </s:Envelope>

  10. SOAP – Aufbau Response <?xmlversion="1.0"?> <s:Envelopexmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Header> <m:RequestID xmlns:m="http://www.socialnetwork-db.de/soap"> a3f5c109b </m:RequestID> </s:Header> <s:Body> <m:DbResponsexmlns:m="http://www.socialnetwork-db.de/soap"> <m:user> <!-- Infos zum User --> </m:user> </m:DbResponse> </s:Body> </s:Envelope>

  11. SOAP REST vs

  12. torest = ausruhen? RepresentationalState Transfer Quelle: http://bit.ly/tig2b7

  13. REST • Web-Paradigma, aber keine Norm • Interaktionen sind zustandslos • Caching möglich • Repräsentation von Ressourcen • Baut auf HTTP auf

  14. CRUD CREATE READ UPDATE DELETE SQL INSERT SELECT UPDATE DELETE HTTP POST GET PUT DELETE

  15. Status – GET, POST, DELETE User – GET, POST, PUT, DELETE Like– GET, POST, DELETE

  16. Quelle: https://farm1.static.flickr.com/194/503716476_6f08285ac3_o.png

  17. Alexa-Rank: 2 800 Mio. aktive Nutzer

  18. Alexa-Rank: 9 100 Mio. aktive Nutzer

  19. Alexa-Rank: 13 Mehr als 135 Mio. Nutzer

  20. 50 Mio. Nutzer

  21. Zugriff auf Daten per… • Graph API (Facebooks REST API) • REST API (, Streaming API, Search API) • REST API • REST API (noch in Entwicklung)

  22. Wo SOAP genutzt wird: • Flickr (neben REST-API) • eBay Powerseller • Amazon (neben REST-API) • Google Search API bis 2009 (eingestellt)

  23. Beispiele https://graph.facebook.com GET /{userid}/ GET /{userid}/feed GET /{statusid} GET /{statusid}/likes POST /{statusid}/likes DELETE /{statusid}/likes

  24. Beispiele https://api.twitter.com/1 GET /users/lookup.json?screen_name={name} GET /statuses/public_timeline.xml POST /statuses/update POST /statuses/destroy/{tweet-id} GET /users/profile_image/{twitter-username}

  25. Quelle: http://www.readwriteweb.com/hack/2011/07/twitter-serves-more-api-calls.php

  26. Viele Nutzer + viele Daten= viel Traffic Quelle: http://www.flickr.com/photos/vgm8383/2191223539

  27. Rate-Limits: • Je Applikation 600 Anfragen in 600 sec • Je IP 150/h oder je Benutzer 350/h • Netzwerk-Updates: 300/h je Benutzer • Je Entwickler 1000 pro Tag

  28. Pagination: • offset, limit / until, since /paging.next, paging.previouspage, rpp (return per page) / max_id • start, count • maxResults, nextPageToken

  29. Quelle: http://www.flickr.com/photos/brandoncwarren/4334456172 Daten in Echtzeit bekommen

  30. Twitter Streaming API Response HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.25) {…} {…} {…}

  31. Quelle: http://www.etuc.org/IMG/jpg/2000-Euromanif_Porto02-2.jpg It‘sdemo time

  32. SOAP REST vs

  33. Fazit • REST bietet Caching • REST ist skalierbarer • REST lässt sich mit HTTP einfach in Anwendungen oder Webseiten einbinden • SOAP zustandsorientiert, REST zustandslos • REST verursacht weniger Daten-Traffic • SOAP bietet mehr Zuverlässlichkeit bei der Übertragung • Mit REST ist die Sicherheit in Webanwendungen einfacher kontrollierbar

  34. Vielen Dank für die Aufmerksamkeit! POST /question GET /answer

More Related