Sha256: 299c7c1246deca0785d76aa600b73e41d19e0dc039858a49fa57db36bb407937

Contents?: true

Size: 1.64 KB

Versions: 1

Compression:

Stored size: 1.64 KB

Contents

= comcetera

First stab at a simple class that wraps the Comcetera mobile operator detection service. Give them a msisdn, they give you an operator code. Compile your own list of relevant codes based on wikipedia.

I'm scratching my own itch here, so I'm only adding what I use. Feedback and patches are welcome

== Example

The usual way you'd do a lookup

  Comcetera.username = "meeeeee"
  Comcetera.password = "verysecret"
  comcetera = Comcetera.detect(31612345678)
  comcetera.operator_code # => "T-Mobile"
  comcetera.msisdn        # => "31612345678"

When the lookup does not work due to a timeout
  Comcetera.detect(31612345678) # => nil

When the lookup gives a result, but not what you'd expect

  comcetera = Comcetera.detect(31612345678)
  comcetera.error_code # => "ERR21"
  comcetera.debug # => "QUERYOK\n31612345678 ERR21\nENDBATCH"

== Operator codes

Check the wikipedia page for Mobile Network Codes (http://en.wikipedia.org/wiki/Mobile_Network_Code) for a list of codes that you can expect.

Example: Wikipedia mentions T-Mobile in the Netherlands as: MCC 204, MNC 16. Comcetera would return this as code 20416. This logic seems consistent across countries.

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 Wes Oldenbeuving. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comcetera-0.2.0 README.rdoc