Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How the Web Works: Lecture 8
Search
Abhinav Sharma
January 09, 2014
Education
0
110
How the Web Works: Lecture 8
This talk was designed for a class (98-135) taught at Carnegie Mellon University in Spring 2010.
Abhinav Sharma
January 09, 2014
Tweet
Share
More Decks by Abhinav Sharma
See All by Abhinav Sharma
How the Web Works: Lecture 5
abhinavsharma
1
73
How the Web Works: Lecture 6
abhinavsharma
0
47
How the Web Works: Lecture 7
abhinavsharma
0
45
How the Web Works: Lecture 9
abhinavsharma
0
63
How the Web Works: Lecture 3
abhinavsharma
0
35
How the Web Works: Lecture 2
abhinavsharma
1
46
How the Web Works: Lecture 1
abhinavsharma
2
120
Other Decks in Education
See All in Education
2025年度春学期 統計学 第6回 データの関係を知る(1)ー相関関係 (2025. 5. 15)
akiraasano
PRO
0
170
2025年度春学期 統計学 第8回 演習(1) 問題に対する答案の書き方(講義前配付用) (2025. 5. 29)
akiraasano
PRO
0
130
万博非公式マップとFOSS4G
barsaka2
0
820
2025.05.10 技術書とVoicyとわたし #RPALT
kaitou
1
240
[FUN Open Campus 2025] 何でもセンシングしていいですか?
pman0214
0
220
質のよいアウトプットをできるようになるために~「読む・聞く、まとめる、言葉にする」を読んで~
amarelo_n24
0
190
自己紹介 / who-am-i
yasulab
PRO
3
5.3k
中間活動報告会 人材育成WG・技術サブWG / 20250808-oidfj-eduWG-techSWG
oidfj
0
310
学習効果が高いフィードバックの仕方(ルース・バトラーの実験)
hysmrk
4
130
Case Studies and Course Review - Lecture 12 - Information Visualisation (4019538FNR)
signer
PRO
1
2.1k
20250807_がんばらないコミュニティ運営
ponponmikankan
0
150
JOAI2025講評 / joai2025-review
upura
0
380
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
Six Lessons from altMBA
skipperchong
28
4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
The Cost Of JavaScript in 2023
addyosmani
53
8.8k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
A better future with KSS
kneath
239
17k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Transcript
None
Lecture 8 Building Social Apps
None
XML
XML HTML Generalized Format for structured data XML <=> DOM
Tree .xml Files XML Parsers out there... JSON : HashTable :: XML : Tree
<courses> <course> <id> <name> <desc> <prof> <course> <id> <name> <desc>
<prof>
Finally, we don’t need to talk pretty to the humans!
Yeah, screw NLP!
Haha, noobs!
None
API
APIs Application Programming Inteface Library of Functions ... for some
langauge Common Theme ex. Java Sound API
Facebook knows so much about my users. If only... We’ll
share it, after all, people will think we’re awesome!
Sweet! I code in PHP, Ruby, Python, Java, C, and
Brainf*ck STFU
Sweet! I code in PHP, Ruby, Python, Java, C, and
Brainf*ck Ok, we’ll give you a standard format.
API = HTTP + XML Returning Data (beyond HTML) Making
requests (beyond GET & POST)
REST made with love HTTP
REST Representational State Transfer Its not that fancy. Standard for
Communication Uses HTTP in depth With XML or JSON myhost.com/...
Public APIs
My
Videos Users leavebritneyalone Chris Crocker starwarskid Darth Vader icanhazcheezburger The
Cat icanhazmuffins The Cat
GET www.google.com 200 OK
GET www.google.com Hello, World!
Request GET POST Response 200 OK 404 Not Found 500
Internal Server Error ....
GET POST PUT DELETE
GET api.mytube.com 200 OK
GET api.mytube.com starwarskid leavebritneyalone ...
GET api.mytube.com/ starwarskid starwarskid.mp4
DELETE api.mytube.com/ starwarskid 200 OK
DELETE api.mytube.com/ terminator2 404 Not Found
RESTful Resource GET POST PUT DELETE api.mytube.com api.mytube.com/ vid_id List
Members Replace Collection Create New Item Delete Collection Retrieve Data Update Item Member is Collection Delete Item
REST APIs
Parse Response XML using PHP http://php.net/manual/en/book.xml.php Request Service using GET/POST/PUT/DELETE
http://us.php.net/manual/en/book.curl.php
I use PHP to respond to requests!
None
Hands-On http://phprestsql.sourceforge.net/ http://phprestsql.sourceforge.net/download.html
None
Wrappers aka Client Libraries
Wrappers import mytube.py mt = new MyTube(auth) mt.getVideos() mt.setVideo(vid, new.mp4)
My
Facebook API
Facebook Apps Is like a website Inside of Facebook Access
to Facebook Data friends, networks, about... Users “add” applications Not your domain name
Canvas URL apps.facebook.com/... Callback URL myhost.com/...
Let See One http://apps.facebook.com/iplcricket/
Lets Build One www.cmuwebworks.com/movies/facebook_app.mov
Hello++
myhost.com/... <fb:friends> <ol> <li>Friend1</li> <li>Friend2</li> <li>Friend3</li> </ol>
FBML Is an extension of SQL With special <fb:> tags
Invalid as HTML Facebook reparses Canvas-Callback Model myhost.com/...
JS & FQL Facebook restricts JS Called FBJS FQL is
SQL-like way to access data on Facebook More general than friends->get() myhost.com/...
Facebook Connect Your Website + Facebook Authentication Feed Social Graph
Implementation Details Later
http://wiki.developers.facebook.com
Other APIs
None
YouTube API Data API: Finds the right video Data API
is REST Based Player API: Customizable Player Player API is Flash Based
Data API Google Data API HTTP Request HTTP + XML
Response Similar to REST Java, PHP, Python, ObjC, Javascript Libraries http://code.google.com/apis/gdata/
Data API Search for Videos Standard Streams (Most Popular) Upload,
Update, Delete Videos
Player API Data API: Finds Video Player : Plays Video
Flash Player (.swf file) With Parameters player colors, loop video, etc....
http://code.google.com/apis/youtube/
None
Twitter API Two APIs (Oh Noes!) Historical Reasons REST API,
Search API Completely Open
Twitter API REST API Search API User information, social data,
etc... Search by tags, trends, etc...
http://apiwiki.twitter.com
Here’s What Matters Everyone has APIs Too many to discuss
here Usually REST Based PHP libraries common Find the service, read docs
One Last Thing http://code.google.com/p/schedulematch/ http://apps.facebook.com/cmuschedule/
Please Help
Photo Credits http://lolmartshirts.com/wp-content/uploads/2010/01/omgwtfbbq1.jpg http://www.johnberns.com/wp-content/uploads/2009/06/01-raw-xml-in-vim-no-whitespace.png http://www.flickr.com/photos/29063159@N07/2714200496/sizes/o/ http://www.xkcd.com/715/
None