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
Firefox OS勉強会 4th Untitled
Search
masawada
October 16, 2013
Technology
0
1.1k
Firefox OS勉強会 4th Untitled
masawada
October 16, 2013
Tweet
Share
More Decks by masawada
See All by masawada
よりよいレビュー環境を求めて / A code review odyssey
masawada
0
2.8k
フロントエンドの秩序は保たれているか?
masawada
0
3.9k
Getting Started with ScratchX
masawada
0
610
GyaPC::Asia Tokyo 2015 LT
masawada
0
1.4k
Privileged Apps with Vue.js
masawada
0
150
Chikubeam
masawada
1
1.4k
Git講習 2014.04.15
masawada
1
300
Hack U at UEC 2014.03.27
masawada
0
1.4k
C Lecture 2013.09.19
masawada
0
140
Other Decks in Technology
See All in Technology
理想の組織も自分たちで作ろう! ―LayerXの「全員採用」を支える文化 / How to create our own ideal team
ar_tama
6
2.2k
『LeanとDevOpsの科学』をきちんと解読する 〜Four Keys だけじゃ絶対もったいなくなる話〜
bonotake
27
6.5k
実録_マルチテナント環境でのGmailガイドライン対応
ryuichi1208
7
1.5k
サイボウズのQAエンジニア育成
cybozuinsideout
PRO
3
550
fujiwara-ware OSSをひたすら紹介する/ya8-2024
fujiwara3
7
370
ISUCON入門以前_ISUNARABE_LT#1
sadnessojisan
13
2.5k
書を捨てよ、現場へ出よう
nwiizo
11
8.7k
The Disturbing Truth: Why Do Most Software Projects Suck?
lemiorhan
0
110
どうやってWebサービスのページ表示速度を1/3にしたか / how-to-reduce-display-speed
pinkumohikan
2
470
The Twelve-Factor App とクラウドアプリケーションのコスト
ny7760
3
260
履歴データテーブルとの向き合い方_PHPerKaigi2024
gennei
25
6.7k
Command-line interface tool design / PHPerKaigi 2024
k1low
4
1k
Featured
See All Featured
Writing Fast Ruby
sferik
619
59k
A better future with KSS
kneath
230
16k
Bash Introduction
62gerente
604
210k
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
How GitHub Uses GitHub to Build GitHub
holman
467
290k
Making Projects Easy
brettharned
106
5.4k
Designing for Performance
lara
601
67k
Done Done
chrislema
178
15k
Keith and Marios Guide to Fast Websites
keithpitt
407
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
23
1.9k
The Cult of Friendly URLs
andyhume
72
5.6k
Transcript
໊শະઃఆ 2013.10.16 Firefox OSษڧձ 4th @masawada
Έͳ͞Μ
͜ΜΜ
masawada
None
ࣗݾհ • ిؾ௨৴େֶ ใཧֶ෦ ใɾ௨৴ֶՊ 2 • ΤϦΞϫϯηάͱ͔ • Rubyͱ͔JavaScriptͱ͔
masawada.me
FxOS & Win8 ϋοΧιϯ
αΠίʔ αΠίʔ
ຊ
໊শະઃఆ 2013.10.16 Firefox OSษڧձ 4th @masawada
None
None
ؒʹ߹Θͳ͔ͬͨ
Twitter
ΈΜͳ
͍͖ͩ͢
Twitter
None
2013/10/16 17:43
ϋογϡλά
#FxOS
͝ҙݟɾ࣭
#FxOS
Twitter
TwitterΫϥΠΞϯτ Λ࡞Ζ͏
TwitterΫϥΠΞϯτ ࣍ੈͷHello, world
Hello, world TwitterΫϥΠΞϯτ ςΩετೖྗ × ˕ ςΩετग़ྗ ˕ ˕ ը૾දࣔ
˚ ◦ Ϧετදࣔ ˚ ◦ ωοτϫʔΩϯά × ˕
ి௨େੜࡏֶதʹ1 TwitterΫϥΠΞϯτΛ࡞Δ
None
None
TwitterΫϥΠΞϯτ Λ࡞Ζ͏
Twitter Libraries
None
None
Node.js͚ͬΆ͍
Cross Origin੍ݶ͕ ݪҼʁ
→࡞Ζ͏
Ͱ͖·ͨ͠
Firefox OS͚ Twitter APIϥΠϒϥϦ
Violet.js
۩ମతʹԿ͕ Firefox OS͚ʁ
// XHR var xhr = new XMLHttpRequest({mozSystem: true}); // manifest.webapp
"type": "privileged", "permissions": { “systemXHR”: {} }
violet.js • ΄ͱΜͲͷAPIΤϯυϙΠϯτʹରԠ → (ະςετ…) • Firefox OSΞϓϦͱͯ͠͏ʹ systemXHRͷݖݶΛཁٻ͢Δඞཁ͕͋Δ
͜͜·Ͱ͕ ࠓ7݄ͷͰ͖͝ͱ
FxOS & Win8 ϋοΧιϯ
8/10
FoxBird
σϞ
FoxBird • OAuth: PIN Only • Tweet (statuses/update) • Favorite
• Retweet • Streaming API (GET user)
ॏࢹͨ͜͠ͱ
Streaming APIରԠ
Streaming APIपΓΛ ղઆ
Streaming API ԿΛ͍ͬͯΔͷ͔
REST
None
Streaming API
None
ίωΫγϣϯΛ அ͠ͳ͍
src/streaming.js
var con = Violet.HTTPClient({ method: method, uri: uri }); con.onloading
= function(xhr){ ... };
src/http.js
var xhr = new XMLHttpRequest({mozSystem: true}); // தུ xhr.onreadystatechange =
function(){ if(xhr.readyState === 3){ this.onloading(xhr); }else if(xhr.readyState === 4){ if(xhr.status === 200){ this.onsuccess(xhr); }else{ this.onerror(xhr); } } }.bind(this);
SFBEZ4UBUFͷͷϦετҎԼͷΑ͏ʹͳΓ·͢ɻ ɾ ॳظԽ͞Ε͍ͯ·ͤΜ ɾ ಡΈࠐΈதͰ͢ ɾ ಡΈࠐΈྃ͠·ͨ͠ ɾ ํʹѻ͑·͢ ɾ
ͯྃ͢͠·ͨ͠
SFBEZ4UBUFͷͷϦετҎԼͷΑ͏ʹͳΓ·͢ɻ ɾ ॳظԽ͞Ε͍ͯ·ͤΜ ɾ ಡΈࠐΈதͰ͢ ɾ ಡΈࠐΈྃ͠·ͨ͠ ɾ ํʹѻ͑·͢ ɾ
ͯྃ͢͠·ͨ͠
readyState === 3ͷͱ͖ ߋ৽ΞϦ
var con = Violet.HTTPClient({ method: method, uri: uri }); con.onloading
= function(xhr){ var lines = xhr.responseText.split('\r\n'); if(!lines[lines.length-2]){ return false; } callback(JSON.parse(lines[lines.length-2])); };
Streaming APIରԠ
violet.jsΛͬͯΈΔ
ΫϥΠΞϯτΛ ࡞ͬͯΈΔ
ΫϥΠΞϯτΛ࡞Δ • πΠʔτػೳ • Streaming APIͰλΠϜϥΠϯಡΉ • UIBuilding BlocksΛ͏
σϞ
؆୯ʹ࡞ΕΔ
ߴ։ൃͰ͖Δ
[ߴ։ൃ][Google ݕࡧ]
ੋඇ ͬͯΈ͍ͯͩ͘͞
࠷ޙʹ
v0.2.0
v0.2.0ͷ৽ػೳ • POST statuses/filterʹରԠ • ͬͯstreamingdeprecated • userstreamʹͳΓ·ͨ͠ • v0.3.0Ͱফ͑·͢
• POST statuses/update_with_mediaʹରԠ
͏͙͢ϦϦʔε
͋Γ͕ͱ͏͍͟͝·ͨ͠