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.2k
Firefox OS勉強会 4th Untitled
masawada
October 16, 2013
Tweet
Share
More Decks by masawada
See All by masawada
10年続くサービスのデータを1日未満のメンテナンスウィンドウで安全に移管する
masawada
5
1.9k
よりよいレビュー環境を求めて / A code review odyssey
masawada
0
2.8k
フロントエンドの秩序は保たれているか?
masawada
1
4k
Getting Started with ScratchX
masawada
0
650
GyaPC::Asia Tokyo 2015 LT
masawada
0
1.4k
Privileged Apps with Vue.js
masawada
0
160
Chikubeam
masawada
1
1.5k
Git講習 2014.04.15
masawada
1
300
Hack U at UEC 2014.03.27
masawada
0
1.5k
Other Decks in Technology
See All in Technology
生成AIの強みと弱みを理解して、生成AIがもたらすパワーをプロダクトの価値へ繋げるために実践したこと / advance-ai-generating
cyberagentdevelopers
PRO
1
190
バクラクにおける可観測性向上の取り組み
yuu26
3
430
AWSコンテナ本出版から3年経った今、もし改めて執筆し直すなら / If I revise our container book
iselegant
15
4k
Commitment vs Harrisonism - Keynote for Scrum Niseko 2024
miholovesq
6
1.2k
使えそうで使われないCloudHSM
maikamibayashi
0
170
[JAWS-UG金沢支部×コンテナ支部合同企画]コンテナとは何か
furuton
3
300
Gradle: The Build System That Loves To Hate You
aurimas
2
150
LeSSに潜む「隠れWF病」とその処方箋
lycorptech_jp
PRO
2
120
コンテナのトラブルシューティング目線から AWS SAW についてしゃべってみる
kazzpapa3
1
110
신뢰할 수 있는 AI 검색 엔진을 만들기 위한 Liner의 여정
huffon
0
390
「 SharePoint 難しい」ってよく聞くけど、そんなに言うなら8歳の息子に試してもらった
taichinakamura
1
670
Autify Company Deck
autifyhq
1
39k
Featured
See All Featured
Happy Clients
brianwarren
97
6.7k
Raft: Consensus for Rubyists
vanstee
136
6.6k
GraphQLとの向き合い方2022年版
quramy
43
13k
Code Review Best Practice
trishagee
64
17k
Navigating Team Friction
lara
183
14k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Optimizing for Happiness
mojombo
376
69k
The Cult of Friendly URLs
andyhume
78
6k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Rails Girls Zürich Keynote
gr2m
93
13k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
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ʹରԠ
͏͙͢ϦϦʔε
͋Γ͕ͱ͏͍͟͝·ͨ͠