14. But we cannot give up the fascinating
features of Japanese mobile phones ...
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
15. Motivation:
want to build websites for Japanese
mobile phones in Rails way.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
21. SHIDARA Yohji dara
‣ Jpmobile the author of Jpmobile
‣ http://d.hatena.ne.jp/darashi
http://twitter.com/darashi
in Japanese)
‣
born in Sapporo, live in Sapporo,
love Sapporo
-- 1.5hrs. from Tokyo by air œ {Ruby c200 8 Sf[^
‣ a graduate studentœ { Œ ^ Cg Ł
‣ Ruby Sapporo Staff
œ { Œ ^ Cg ¨
‣ RubyKaigi2008 Staff œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
31. You can find the nearby soupcurry
restaurants with your mobile (using
GPS). -- if you are in Japan ;-)
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
32. You can find the nearby soupcurry
restaurants with your mobile (using
GPS). -- if you are in Japan ;-)
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
33. The reusable component dragged out
from soupcurry.info is the origin of
Jpmobile.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
38. with Jpmobile,
<% if request.mobile? %>
from mobile!
<% else %>
from PC!
<% end %> œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
39. case request.mobile
when Jpmobile::Mobile::Docomo
# for DoCoMo
when Jpmobile::Mobile::Au
# for au
when Jpmobile::Mobile::Softbank
# for SoftBank
when Jpmobile::Mobile::Willcom
# for Willcom
when Jpmobile::Mobile::Emobile
# for EMOBILE œ {Ruby c200 8 Sf[^
else
œ { Œ ^ Cg Ł
# for PC œ { Œ ^ Cg ¨
end œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
41. If you want to switch templates for PCs
and for mobiles, or for each operator,
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
42. just put mytemplate.html.erb and
mytemplate_mobile.html.erb, or
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
51. It should be frustrating to input the
password with your mobile every time
you are going to login.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
52. Usually the identifier of the device or
the subscriber can be obtained.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
53. Of course they are based on the various
specifications!
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
55. Note that they are not creditable
because these identifiers are just
passed as plain text.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
56. The security will be slightly improved
with combining IP-address verification.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
58. We may want to block PCs for some
(marketing?) reasons,
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
59. or we may want to check if the
identifiers (for a device or a subscribe)
is surely passed from mobile.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
60. The operators provides the information
of the IP-address ranges on the website
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
61. of course in various formats, and even
worse, usually they are not machine
readable (dirty scraping is needed).
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
62. Since Jpmobile contains the tables
obtained from these machine-unfriendly
websites,
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
69. The screensize differs according to the
model.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
70. In order to optimize the output, we
need the information about the screen.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
71. The information may be passed via
HTTP header, or not.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
72. We need to scrape the official websites
in case that the information in the
header is not available.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
83. Some mobiles do not support UTF-8 or
stop sending emoticons under UTF-8
communication.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
84. We need to communicate with them in
Shift-JIS (a legacy but one of the most
commonly used encoding).
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
85. in a controller:
class MyController <
ApplicationController
mobile_filter
end
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
91. I’m a student, so I don’t have many
mobile-phones to test Jpmobile on.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
92. I often ask my colleagues for help,
paying a canned coffee.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
93. So, if you find out some problems or if
you make any improvement of
Jpmobile, please let me know.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
94. It may take long, but I’d like to work
on it.
œ {Ruby c200 8 Sf[^
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨
œ { Œ ^ Cg Ł
œ { Œ ^ Cg ¨