Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Firefox OS勉強会 4th Untitled
masawada
October 16, 2013
Technology
0
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.6k
フロントエンドの秩序は保たれているか?
masawada
0
3.8k
Getting Started with ScratchX
masawada
0
550
GyaPC::Asia Tokyo 2015 LT
masawada
0
1.3k
Privileged Apps with Vue.js
masawada
0
140
Chikubeam
masawada
1
1.3k
Git講習 2014.04.15
masawada
1
290
Hack U at UEC 2014.03.27
masawada
0
1.4k
C Lecture 2013.09.19
masawada
0
130
Other Decks in Technology
See All in Technology
PCI DSS に準拠したシステム開発
yutadayo
0
310
開発者と協働できるメトリクスダッシュボードを作ろう!/SRE Lounge 2023
lmi
3
500
OpenShiftでスポットVMを使おう.pdf
jpishikawa
1
350
OpenShiftのリリースノートを整理してみた
loftkun
2
390
Exploring MapStore Release 2022.02: improved 3DTiles support and more
simboss
PRO
0
370
Periodic Multi-Agent Path Planning
hziwara
0
110
re:Invent2022 前後の Amazon EventBridge のアップデートを踏まえつつ、情シスの仕事をより楽しくしたい話。 / EventBridge for Information Systems Department
_kensh
2
740
組織に対してSREを適用するとどうなるか
kuniim
7
2.8k
データベースの発表には RDBMS 以外もありますよ
maroon1st
0
240
230125 古いタブレットの活用 かーでぃさん
comucal
PRO
0
16k
SSMパラメーターストアでクロススタック参照の罠を回避する
shuyakinjo
0
7.2k
オブザーバビリティのベストプラクティスと弥生の現状 / best practices for observability and YAYOI’s current state
yayoi_dd
0
100
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
51
2.9k
Making Projects Easy
brettharned
102
4.8k
Become a Pro
speakerdeck
PRO
6
3.2k
GraphQLとの向き合い方2022年版
quramy
20
9.9k
Mobile First: as difficult as doing things right
swwweet
213
7.8k
Pencils Down: Stop Designing & Start Developing
hursman
114
10k
The Power of CSS Pseudo Elements
geoffreycrofte
52
4.3k
Code Reviewing Like a Champion
maltzj
508
38k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
318
19k
Git: the NoSQL Database
bkeepers
PRO
419
60k
Robots, Beer and Maslow
schacon
154
7.3k
How to Ace a Technical Interview
jacobian
270
21k
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ʹରԠ
͏͙͢ϦϦʔε
͋Γ͕ͱ͏͍͟͝·ͨ͠