Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DoCoMoのGPS対応/非対応を判定するメソッドが欲しい #11

Open
darashi opened this issue Dec 7, 2009 · 0 comments
Open
Labels

Comments

@darashi
Copy link
Owner

darashi commented Dec 7, 2009

こんな感じでGPS対応/非対応が分かるとうれしいです。

module Jpmobile::Mobile

==DoCoMo携帯電話

class Docomo < AbstractMobile
# 対応するUser-Agentの正規表現
USER_AGENT_REGEXP = /^DoCoMo/

# GPS取得に対応している端末名
# http://www.nttdocomo.co.jp/product/function_purpose/gps/
GPS_SUPPORTED_MODEL_NAMES = ["D904i","F801i","D905i","F905i","N905i","P905i","SH905i","SO905i","N905imyu","SO905iCS","SA800i","F884i","F883iES","F883iESS"]

・・・

# 簡易位置情報(オープンiエリア)取得に対応している場合は +true+ を返す。
# GPS非対応機種は全てこちら
def supports_location?
  ! GPS_SUPPORTED_MODEL_NAMES.include?(model_name)
end

# GPS位置情報取得に対応している場合は +true+ を返す。
def supports_gps?
  GPS_SUPPORTED_MODEL_NAMES.include?(model_name)
end

private

・・・

end

dara が変更 – 7月 02 2008 * 12:53
確かに嬉しいのですが、テーブルをメンテナンスするのはけっこう大変そうです。 htmlからscrapeするスクリプトを書く必要がありそうですね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant