SlideShare a Scribd company logo
1 of 32
Download to read offline
OpenSource TypePad Mobile
                   Hiroshi Sakai
                  Six Apart K.K.
                    id:ziguzagu
TypePad
What's TypePad ?

●   ブログホスティングサービス
●   Since 2003
●   ASP / ライセンス
●   Movable Type のコードを元に開発
    –   それぞれ別の方向に進化したので、似たような部分
        はあるにせよ基本的に別物
What becomes OpenSource?


            PC     携帯
   管理
   閲覧               ココ
TypeCast
Overview

●   ウェブサービスに Mobile 用の閲覧機能を作る
    ためのアプリケーション
●   フレームワークとしてMovable Type Open
    Source を利用
●   各携帯キャリアごとに最適化されたHTML
●   データソースとして Atom API 経由で取得し
    た Atom を利用
Functions

●   ブログ記事一覧 (Atom Feed)
●   ブログ個別記事 (Atom Entry)
●   コメント一覧(Atom Comment)
●   端末別に画像の変換、リサイズ、圧縮
●   MobileLinkDiscover
Generic Processing

●   Atom / Atom API
●   共通のHTML生成
●   各キャリア向けHTML変換
Atom / Atom API
Atom as DataSource

●   XML::Atom::Client
    –   今のところ API の URL は MT にマッチしたもの
●   取得した Atom から、MT::Blog /
    MT::Entry / MT::Comment オブジェクトも
    どきを生成
●   Atom Server 側では UserAgent を判別して
    meta / link を追加したりも
Generate
Common HTML
How to generate
●   MTOS のテンプレートエンジンを利用
    –   MTタグを使ったテンプレート
●   コンテンツ中の a / img タグのURL変換
    –   TypeCast 経由で表示するための URL に変換
●   コンテンツ(HTML)の分割
    –   複数ページに分割してサイズ制限をクリア
●   TypePad 絵文字記法のフィルタ
    –   本来ここでやるべきではないので一旦実装外し
Filtering HTML
       for
     Mobile
Filtering Basics

●   HTMLタグ書き換え
    –   DOCTYPE, accesskey, istyle, etc...
●   CSSの適用
    –   外部 CSS を style 要素化、style 属性化
●   文字コード変換
    –   Encode::JP::Mobile 任せ
    –   utf-8 / ShiftJIS どちらかで
For DoCoMo

●   文字コード
    –   FOMA: utf-8
    –   Mova: ShiftJIS
●   DOCTYPE, istyle 置換
●   外部CSSを各要素のstyle属性として挿入
●   style に font-size プロパティを持つ要素のテ
    キストノードは、span に入れる
For KDDI

●   文字コード: ShiftJIS
●   DOCTYPE 置換
●   外部CSSをstyle要素として置き換え
For Softbank

●   文字コード
    –   3G以降: utf-8
    –   3G以前: ShiftJIS
●   DOCTYPE, accesskey, istyle 置き換え
●   外部CSSはそのまま
For Others

●   Willcom
    –   DoCoMo(FOMA)と同じ
●   EMOBILE
    –   まだやってない
    –   DoCoMo(FOMA)と同じでよさげ?
Go to CPAN
HTML::Split

●   HTML を指定文字数で分割
●   HTML タグを壊さない
    –   HTMLタグ途中で分割したりしない
●   改ページしても DOM ツリーを壊さない
●   A 要素は終了タグまでをまとめてだす
    –   テキストノード、子ノードがページ分割文字数を超
        えない限りは途中で分割しない
HTML::Split Example
my $html = <<HTML;
<div class=quot;pkgquot;>
<h1>HTML::Split</h1>
<p>Splitting HTML by number of
characters.</p>
</div>
HTML;

my @pages = HTML::Split->split(
    html => $html, length => 50,
);
HTML::Split Example

Part1:
<div class=quot;pkgquot;>
<h1>HTML::Split</h1>
<p>Splittin</p></div>

Part2:
<div class=quot;pkgquot;>
<p>g HTML by number of characters.</p></
div>
HTML::MobileFilter (仮)

●   Mobile 用 HTML を生成するための Filter
●   HTML::Parser を継承した Parser
    –   結構ごりごりがんばった感じのコード
●   でも、まだupできない...
    –   実装はすでにあるもののテストコードが皆無...
●   Coming Soon!!
Open Emoticon
We love Emoticons !!

●   TypePad の絵文字画像を GPL2 / CC で公開
Performance Tuning
Where is bottleneck ?

●   Atom サーバーに負荷がかかる
    –   Atom をキャッシュ(in memcached)して Atom
        API へのアクセス数を減らす
●   HTML生成時に負荷がかかる
    –   共通HTMLをキャッシュ(in memcached)して、
        HTML生成にかかる処理時間を半分以下に
The Goal
   of
TypeCast
We heading...

●   Atom API を持つサービスを広く Mobile 対
    応できるように
    –   Atom API へのアクセス、Atom からのオブジェ
        クト生成を抽象化
    –   More configurable
●   Open な Mobile 開発を
How to get the TypeCast ?

●   Project in Google Code
    –   http://code.google.com/p/typecastmobile/
●   Google Group
    –   http://groups.google.co.jp/group/typecastmobile
We are hiring !!
http://www.sixapart.jp/jobs/
Thanks
      &
Enjoy Mobile !!

More Related Content

What's hot

英語ブログのスヽメ - 1000スピーカープロジェクト#5
英語ブログのスヽメ - 1000スピーカープロジェクト#5英語ブログのスヽメ - 1000スピーカープロジェクト#5
英語ブログのスヽメ - 1000スピーカープロジェクト#5
Yusuke Kawasaki
 
Hackers = Security Experts
Hackers = Security ExpertsHackers = Security Experts
Hackers = Security Experts
Kana Shinoda
 
【12-C-5】 自律型移動ロボットのソフトウェア技術
【12-C-5】 自律型移動ロボットのソフトウェア技術【12-C-5】 自律型移動ロボットのソフトウェア技術
【12-C-5】 自律型移動ロボットのソフトウェア技術
devsumi2009
 
数字から読む信号機の傾向と精度2020
数字から読む信号機の傾向と精度2020数字から読む信号機の傾向と精度2020
数字から読む信号機の傾向と精度2020
Jun Sasaki
 
【12-D-2】 WPF アプリケーション開発
【12-D-2】 WPF アプリケーション開発【12-D-2】 WPF アプリケーション開発
【12-D-2】 WPF アプリケーション開発
devsumi2009
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
iwata
 

What's hot (20)

PHP超入門@LL温泉
PHP超入門@LL温泉PHP超入門@LL温泉
PHP超入門@LL温泉
 
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
Cloud era -『クラウド時代』マッシュアップ技術による地方からの世界発信
 
Heap overflow
Heap overflowHeap overflow
Heap overflow
 
英語ブログのスヽメ - 1000スピーカープロジェクト#5
英語ブログのスヽメ - 1000スピーカープロジェクト#5英語ブログのスヽメ - 1000スピーカープロジェクト#5
英語ブログのスヽメ - 1000スピーカープロジェクト#5
 
Hackers = Security Experts
Hackers = Security ExpertsHackers = Security Experts
Hackers = Security Experts
 
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3088
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3088俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3088
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3088
 
【12-C-5】 自律型移動ロボットのソフトウェア技術
【12-C-5】 自律型移動ロボットのソフトウェア技術【12-C-5】 自律型移動ロボットのソフトウェア技術
【12-C-5】 自律型移動ロボットのソフトウェア技術
 
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3714
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3714俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3714
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3714
 
Bynet2.3 Microsoft Silverlight3 using for business
Bynet2.3 Microsoft Silverlight3 using for businessBynet2.3 Microsoft Silverlight3 using for business
Bynet2.3 Microsoft Silverlight3 using for business
 
数字から読む信号機の傾向と精度2020
数字から読む信号機の傾向と精度2020数字から読む信号機の傾向と精度2020
数字から読む信号機の傾向と精度2020
 
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 2804
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 2804俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 2804
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 2804
 
PHP Conference 09 Japan Microsoft
PHP Conference 09 Japan MicrosoftPHP Conference 09 Japan Microsoft
PHP Conference 09 Japan Microsoft
 
優雅與摩登的使用docker container和資料庫建立部落格.
優雅與摩登的使用docker container和資料庫建立部落格.優雅與摩登的使用docker container和資料庫建立部落格.
優雅與摩登的使用docker container和資料庫建立部落格.
 
【12-D-2】 WPF アプリケーション開発
【12-D-2】 WPF アプリケーション開発【12-D-2】 WPF アプリケーション開発
【12-D-2】 WPF アプリケーション開発
 
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3705
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3705俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3705
俄语GOST标准,技术规范,法律,法规,中文英语,目录编号RG 3705
 
Bynet2.3 Microsoft. Mediacontent delivery using IIS7 and Silverlight3
Bynet2.3 Microsoft. Mediacontent delivery using IIS7 and Silverlight3Bynet2.3 Microsoft. Mediacontent delivery using IIS7 and Silverlight3
Bynet2.3 Microsoft. Mediacontent delivery using IIS7 and Silverlight3
 
Ribbit
RibbitRibbit
Ribbit
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Visual Studio Team System 2010
Visual Studio Team System 2010Visual Studio Team System 2010
Visual Studio Team System 2010
 
當時間的座標落在格林威治的左邊
當時間的座標落在格林威治的左邊當時間的座標落在格林威治的左邊
當時間的座標落在格林威治的左邊
 

Viewers also liked

Viewers also liked (8)

080930 E Sangathan Web Press Clippings Book
080930 E Sangathan Web Press Clippings Book080930 E Sangathan Web Press Clippings Book
080930 E Sangathan Web Press Clippings Book
 
MTDDC 2013 LT | Hello, my little giant
MTDDC 2013 LT | Hello, my little giantMTDDC 2013 LT | Hello, my little giant
MTDDC 2013 LT | Hello, my little giant
 
Changing Template Engine
Changing Template EngineChanging Template Engine
Changing Template Engine
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
Hacking Movable Type Open Source
Hacking Movable Type Open SourceHacking Movable Type Open Source
Hacking Movable Type Open Source
 
Ninestep
NinestepNinestep
Ninestep
 
Perlbal Tutorial
Perlbal TutorialPerlbal Tutorial
Perlbal Tutorial
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 

Similar to Open Source Type Pad Mobile

技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac
terada
 
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
devsumi2009
 
【13-C-4】 「もう業務はとまらない!オフライン機能を使った業務アプリケーションの実例と最新 Curl 情報」
【13-C-4】 「もう業務はとまらない!オフライン機能を使った業務アプリケーションの実例と最新 Curl 情報」【13-C-4】 「もう業務はとまらない!オフライン機能を使った業務アプリケーションの実例と最新 Curl 情報」
【13-C-4】 「もう業務はとまらない!オフライン機能を使った業務アプリケーションの実例と最新 Curl 情報」
devsumi2009
 
Sc2009autumn 次世代Daoフレームワーク Doma
Sc2009autumn 次世代Daoフレームワーク DomaSc2009autumn 次世代Daoフレームワーク Doma
Sc2009autumn 次世代Daoフレームワーク Doma
Toshihiro Nakamura
 
20090313 Cakephpstudy
20090313 Cakephpstudy20090313 Cakephpstudy
20090313 Cakephpstudy
Yusuke Ando
 
20090822 Arg Cafe.Final
20090822 Arg Cafe.Final20090822 Arg Cafe.Final
20090822 Arg Cafe.Final
kulibrarians
 

Similar to Open Source Type Pad Mobile (20)

技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac
 
文献紹介:Semantic-based information retrieval in support of concept design.
文献紹介:Semantic-based information retrieval in support of concept design.文献紹介:Semantic-based information retrieval in support of concept design.
文献紹介:Semantic-based information retrieval in support of concept design.
 
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
 
Cloud Computing - クラウドコンピューティング(会津産学懇話会)
Cloud Computing - クラウドコンピューティング(会津産学懇話会)Cloud Computing - クラウドコンピューティング(会津産学懇話会)
Cloud Computing - クラウドコンピューティング(会津産学懇話会)
 
Apache Tapestry
Apache TapestryApache Tapestry
Apache Tapestry
 
【13-C-4】 「もう業務はとまらない!オフライン機能を使った業務アプリケーションの実例と最新 Curl 情報」
【13-C-4】 「もう業務はとまらない!オフライン機能を使った業務アプリケーションの実例と最新 Curl 情報」【13-C-4】 「もう業務はとまらない!オフライン機能を使った業務アプリケーションの実例と最新 Curl 情報」
【13-C-4】 「もう業務はとまらない!オフライン機能を使った業務アプリケーションの実例と最新 Curl 情報」
 
【13 C 2】デベロッパーに贈る!M-V-VMパターンで造るWPFアプリケーション
【13 C 2】デベロッパーに贈る!M-V-VMパターンで造るWPFアプリケーション【13 C 2】デベロッパーに贈る!M-V-VMパターンで造るWPFアプリケーション
【13 C 2】デベロッパーに贈る!M-V-VMパターンで造るWPFアプリケーション
 
20090522 Candycane
20090522 Candycane20090522 Candycane
20090522 Candycane
 
Sc2009autumn 次世代Daoフレームワーク Doma
Sc2009autumn 次世代Daoフレームワーク DomaSc2009autumn 次世代Daoフレームワーク Doma
Sc2009autumn 次世代Daoフレームワーク Doma
 
ZOZOTOWNのマルチクラウドへの挑戦と挫折、そして未来
ZOZOTOWNのマルチクラウドへの挑戦と挫折、そして未来ZOZOTOWNのマルチクラウドへの挑戦と挫折、そして未来
ZOZOTOWNのマルチクラウドへの挑戦と挫折、そして未来
 
Webken 03: Project Design for Optimaizing User Experience
Webken 03: Project Design for Optimaizing User ExperienceWebken 03: Project Design for Optimaizing User Experience
Webken 03: Project Design for Optimaizing User Experience
 
20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編
 
20210119 OCIJP#14 オラクル大橋資料
20210119 OCIJP#14 オラクル大橋資料20210119 OCIJP#14 オラクル大橋資料
20210119 OCIJP#14 オラクル大橋資料
 
P2P Bug Tracking with SD
P2P Bug Tracking with SDP2P Bug Tracking with SD
P2P Bug Tracking with SD
 
20090313 Cakephpstudy
20090313 Cakephpstudy20090313 Cakephpstudy
20090313 Cakephpstudy
 
Where20 2009report
Where20 2009reportWhere20 2009report
Where20 2009report
 
Ubuntu Firefox オススメ・アドオン
Ubuntu Firefox オススメ・アドオンUbuntu Firefox オススメ・アドオン
Ubuntu Firefox オススメ・アドオン
 
20090822 Arg Cafe.Final
20090822 Arg Cafe.Final20090822 Arg Cafe.Final
20090822 Arg Cafe.Final
 
Green IT
Green ITGreen IT
Green IT
 
090309seminar talk about Cloud Computing
090309seminar talk about Cloud Computing090309seminar talk about Cloud Computing
090309seminar talk about Cloud Computing
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Open Source Type Pad Mobile

  • 1. OpenSource TypePad Mobile Hiroshi Sakai Six Apart K.K. id:ziguzagu
  • 3. What's TypePad ? ● ブログホスティングサービス ● Since 2003 ● ASP / ライセンス ● Movable Type のコードを元に開発 – それぞれ別の方向に進化したので、似たような部分 はあるにせよ基本的に別物
  • 4. What becomes OpenSource? PC 携帯 管理 閲覧 ココ
  • 6. Overview ● ウェブサービスに Mobile 用の閲覧機能を作る ためのアプリケーション ● フレームワークとしてMovable Type Open Source を利用 ● 各携帯キャリアごとに最適化されたHTML ● データソースとして Atom API 経由で取得し た Atom を利用
  • 7. Functions ● ブログ記事一覧 (Atom Feed) ● ブログ個別記事 (Atom Entry) ● コメント一覧(Atom Comment) ● 端末別に画像の変換、リサイズ、圧縮 ● MobileLinkDiscover
  • 8. Generic Processing ● Atom / Atom API ● 共通のHTML生成 ● 各キャリア向けHTML変換
  • 10. Atom as DataSource ● XML::Atom::Client – 今のところ API の URL は MT にマッチしたもの ● 取得した Atom から、MT::Blog / MT::Entry / MT::Comment オブジェクトも どきを生成 ● Atom Server 側では UserAgent を判別して meta / link を追加したりも
  • 12. How to generate ● MTOS のテンプレートエンジンを利用 – MTタグを使ったテンプレート ● コンテンツ中の a / img タグのURL変換 – TypeCast 経由で表示するための URL に変換 ● コンテンツ(HTML)の分割 – 複数ページに分割してサイズ制限をクリア ● TypePad 絵文字記法のフィルタ – 本来ここでやるべきではないので一旦実装外し
  • 13. Filtering HTML for Mobile
  • 14. Filtering Basics ● HTMLタグ書き換え – DOCTYPE, accesskey, istyle, etc... ● CSSの適用 – 外部 CSS を style 要素化、style 属性化 ● 文字コード変換 – Encode::JP::Mobile 任せ – utf-8 / ShiftJIS どちらかで
  • 15. For DoCoMo ● 文字コード – FOMA: utf-8 – Mova: ShiftJIS ● DOCTYPE, istyle 置換 ● 外部CSSを各要素のstyle属性として挿入 ● style に font-size プロパティを持つ要素のテ キストノードは、span に入れる
  • 16. For KDDI ● 文字コード: ShiftJIS ● DOCTYPE 置換 ● 外部CSSをstyle要素として置き換え
  • 17. For Softbank ● 文字コード – 3G以降: utf-8 – 3G以前: ShiftJIS ● DOCTYPE, accesskey, istyle 置き換え ● 外部CSSはそのまま
  • 18. For Others ● Willcom – DoCoMo(FOMA)と同じ ● EMOBILE – まだやってない – DoCoMo(FOMA)と同じでよさげ?
  • 20. HTML::Split ● HTML を指定文字数で分割 ● HTML タグを壊さない – HTMLタグ途中で分割したりしない ● 改ページしても DOM ツリーを壊さない ● A 要素は終了タグまでをまとめてだす – テキストノード、子ノードがページ分割文字数を超 えない限りは途中で分割しない
  • 21. HTML::Split Example my $html = <<HTML; <div class=quot;pkgquot;> <h1>HTML::Split</h1> <p>Splitting HTML by number of characters.</p> </div> HTML; my @pages = HTML::Split->split( html => $html, length => 50, );
  • 23. HTML::MobileFilter (仮) ● Mobile 用 HTML を生成するための Filter ● HTML::Parser を継承した Parser – 結構ごりごりがんばった感じのコード ● でも、まだupできない... – 実装はすでにあるもののテストコードが皆無... ● Coming Soon!!
  • 25. We love Emoticons !! ● TypePad の絵文字画像を GPL2 / CC で公開
  • 27. Where is bottleneck ? ● Atom サーバーに負荷がかかる – Atom をキャッシュ(in memcached)して Atom API へのアクセス数を減らす ● HTML生成時に負荷がかかる – 共通HTMLをキャッシュ(in memcached)して、 HTML生成にかかる処理時間を半分以下に
  • 28. The Goal of TypeCast
  • 29. We heading... ● Atom API を持つサービスを広く Mobile 対 応できるように – Atom API へのアクセス、Atom からのオブジェ クト生成を抽象化 – More configurable ● Open な Mobile 開発を
  • 30. How to get the TypeCast ? ● Project in Google Code – http://code.google.com/p/typecastmobile/ ● Google Group – http://groups.google.co.jp/group/typecastmobile
  • 31. We are hiring !! http://www.sixapart.jp/jobs/
  • 32. Thanks & Enjoy Mobile !!