shon / httpagentparser

Python HTTP Agent Parser
http://pypi.python.org/pypi/httpagentparser/
MIT License
222 stars 55 forks source link

Opera Mobile support #18

Closed patrickdessalle closed 12 years ago

patrickdessalle commented 12 years ago

Added support for Opera Mobile on Android devices. Had to fix the incorrect assumption that if the browser is not "Mobile Safari", it is a tablet. For alternative browsers, it will be Opera, Dolphin, Firefox, ... but no conclusion can be drawn about the fact that it is a phone or a tablet.

shon commented 12 years ago

Thanks. Makes sense.

shon commented 12 years ago

Released a new version 1.0.3 containing this fix.

shon commented 12 years ago

Thinking again about this whole device type issue. This what I think https://github.com/shon/httpagentparser/pull/17#issuecomment-5064868 Do you have any comments?

patrickdessalle commented 12 years ago

I would also keep the version clean of device type as more than often it could be wrong. Some cheap tablets are using android as their OS and they would be seen as phone. The Kindle Fire is also based on 2.X code and may be seen as Phone and not Tablet.

I would also add a separate "device_type" key if possible but I'm not sure it can be done reliably.

srs81 commented 12 years ago

Hi, I think you need to support "Opera Mini" string in addition to "Opera Mobi" - and its not only for Android devices, but for a whole bunch of other systems as well. Here are some real-world user string examples of this I've seen just from this month:

patrickdessalle commented 12 years ago

I agree that we should add support for Opera Mini at some time. I didn't add them because I don't have an Opera Mini device to test nor a Opera Mobile on anything else than Android.

But it could also be added in another patch.

shon commented 12 years ago

So I went ahead and cleaned up. Also tests are now moved to tests.py. srs81 you may want to detect Safari and "Mobile Safari" differently by adding new class MobileSafari.

+1 for Opera mini support.