
携帯の絵文字とかよくわかってないのでherokuを使ってjpmobileプラギンのテストすることにしました。上記QRコードでhttp://jpmobile.heroku.comへ飛びます。携帯で絵文字がんがん使って書き込んでください。(ついでのなんの絵文字かも)。
使ってるjpmobileは0.0.2です。
Adsenseが表示されるかどうかもテストしています。PCからだと表示されないはずです。topに表示されていたかどうかも書き込んでいただけるかもありがたいです。もしGoogleのbotがきたら http://jpmobile.heroku.com/googleに足跡を残すようにしています。判別はここを参考に同じことをしています。
Adsenseはデフォルトでchtmlにしています。
そのコードはネット上のどこかでひらったものでhelperに、
[code]
require "uri"
require "open-uri"
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def adsense
ggl={
'ad_type' => 'text_image',
'channel' => '**********',
'client' => 'ca-mb-pub-****************',
'format' => 'mobile_single',
'https' => request.env['HTTPS'] || '',
'host' => 'http://' + (request.env['HTTP_HOST']||''),
'ip' => request.env['REMOTE_ADDR'] || '',
'markup' => 'chtml',
'oe' => 'utf8',
'output' => 'chtml',
'ref' => request.env['HTTP_REFERER'] || '',
'url' => 'http://' + (request.env['HTTP_HOST']||'') + request.env['REQUEST_URI'],
'useragent' => request.env['HTTP_USER_AGENT'] || '',
'dt' => sprintf("%.0f", 1000.0 * Time.now.to_f)
}
if /(\d+)x(\d+)/.match request.env['HTTP_UA_PIXELS'] or
/(\d+),(\d+)/.match request.env['HTTP_X_UP_DEVCAP_SCREENPIXELS']
ggl['u_w'] = Regexp.last_match[1]
ggl['u_h'] = Regexp.last_match[2]
end
url = 'http://pagead2.googlesyndication.com/pagead/ads?' +
ggl.to_a.map{|a| "#{a[0]}=#{u(a[1])}"}.join('&')
if RAILS_ENV == 'development'
begin
a = open(url).read
logger.info a
return a
rescue
logger.error(url)
end
else
url
end
end
end
[/code]
です。