Thanks for the tip! I will try to have a look at the code tomorrow. I
basically have finished the class but I need to plug in some sort of
list that can classify the different user agents into the categories I
mentioned in the previous post...
Simone Carletti wrote:
Hi Christer,
a friend of mine created the best ASP class for user agent sniffing.
It's a long time project, started more than 5 years ago. It's called WBStat.
http://www.useragents.org/develop-wbstat.asp
4 years ago I created a tracking tool and this class was part of the
application core.
We made a kind of partnership: I was in charge of providing the class
tons of new user agents and my friend was in charge of updating the
database.
This is the result: http://www.useragents.org/
Probably on of the huge useragent database, daily updated with
* 153 browsers,
* 221 robots,
* 89 operating systems
* 2045 unique user-agent string (the real database is more than 400k
user agents)
Have a look at what the class can do just from an user agent!
http://www.useragents.org/develop-wbstat.asp?w=demo
I always promised to myself (and to him!) to create a PHP porting of
this excellent tool for ZF.
You should definitely have a look at the class.
It is Italian based but the code is international! ;)
The class is just the core, client definitions are stored in 3 external
XML files that can be easily adapted to ZF needs.
You should definitely have a look at this wonderful piece of code. :)
-- Simone
On Wed, Jan 30, 2008 at 8:26 PM, Christer Edvartsen <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
I have created a page in the wiki that will hold the proposal for a
Zend_UserAgent component. The proposal does not hold that much
information yet, but I will add some more as soon as I get some feedback
from you guys. It's located at
http://framework.zend.com/wiki/display/ZFPROP/Zend_UserAgent+-+Christer+Edvartsen
The component is supposed to be used to classify user agents into some
predefined categories. I suggest the following categories:
* Browser
* RSS Reader
* Mobile Device
* Robot
A Zend_Controller_Action helper could also be made by using this
component but I guess something like this could live outside of a
typical MVC application so I suggest it as a separate component.
There are several user agent databases out there, and the one I was
thinking about using is http://www.user-agents.org/ which has an
extensive list of user agent strings. One problem is that the database
does not have the "Mobile device" category. The list is huge though
(2500+ user agents) and I don't think it would be necessary to use
_every_ user agent string in that database.
Does anyone have any ideas of how to decide of what list we could use
for something like this? The component will be made in such a manner
that developers can add their own list/database if they think the one we
provide is not sufficient.
The component could also be extended to fetch some more detalied
information about mobile devices using WURFL
(http://wurfl.sourceforge.net/).
Any comments?
--
Christer Edvartsen
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
http://cogo.wordpress.com/
--
Christer Edvartsen
[EMAIL PROTECTED]
http://cogo.wordpress.com/