From rainelemental at gmail.com Wed May 1 15:51:32 2013 From: rainelemental at gmail.com (Federico Ulfo) Date: Wed, 1 May 2013 15:51:32 -0400 Subject: [nycphp-talk] Browser detection Message-ID: Hi all, how do you solve the problem of the browser detection? The PHP built in function get_browser() doesn't seams to work very well, it's slow and inaccurate, it also need a huge browscap.ini file to be loaded and updated, and looks like isn't maintained really well. The most accurate library I've found uses the user-agent-string.info API, which isn't very fast, and it doesn't tell the device type, such as iPhone, iPad, Android, etc. Not satisfacted by the available solutions I've decided to create a library that with dependency injection loads other parser, so it's flexible and accurate. The library, Sail\Useragent, is open source and available on packagist: https://github.com/rainphp/useragent -------------- next part -------------- An HTML attachment was scrubbed... URL: From ircmaxell at gmail.com Wed May 1 15:55:15 2013 From: ircmaxell at gmail.com (Anthony Ferrara) Date: Wed, 1 May 2013 15:55:15 -0400 Subject: [nycphp-talk] Browser detection In-Reply-To: References: Message-ID: The best way to do browser detection is to not do it. It's unreliable and difficult to even come close to trying it. Why do you want detection? Anthony On Wed, May 1, 2013 at 3:51 PM, Federico Ulfo wrote: > Hi all, how do you solve the problem of the browser detection? > > The PHP built in function get_browser() doesn't seams to work very well, > it's slow and inaccurate, it also need a huge browscap.ini file to be > loaded and updated, and looks like isn't maintained really well. > > The most accurate library I've found uses the user-agent-string.info API, > which isn't very fast, and it doesn't tell the device type, such as iPhone, > iPad, Android, etc. > > Not satisfacted by the available solutions I've decided to create a > library that with dependency injection loads other parser, so it's flexible > and accurate. The library, Sail\Useragent, is open source and available on > packagist: > https://github.com/rainphp/useragent > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gatzby3jr at gmail.com Wed May 1 17:08:37 2013 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Wed, 1 May 2013 17:08:37 -0400 Subject: [nycphp-talk] Browser detection In-Reply-To: References: Message-ID: This might be useful for you: https://github.com/dmolsen/Detector On Wed, May 1, 2013 at 3:55 PM, Anthony Ferrara wrote: > The best way to do browser detection is to not do it. It's unreliable and > difficult to even come close to trying it. > > Why do you want detection? > > Anthony > > > On Wed, May 1, 2013 at 3:51 PM, Federico Ulfo wrote: > >> Hi all, how do you solve the problem of the browser detection? >> >> The PHP built in function get_browser() doesn't seams to work very well, >> it's slow and inaccurate, it also need a huge browscap.ini file to be >> loaded and updated, and looks like isn't maintained really well. >> >> The most accurate library I've found uses the user-agent-string.infoAPI, which isn't very fast, and it doesn't tell the device type, such as >> iPhone, iPad, Android, etc. >> >> Not satisfacted by the available solutions I've decided to create a >> library that with dependency injection loads other parser, so it's flexible >> and accurate. The library, Sail\Useragent, is open source and available on >> packagist: >> https://github.com/rainphp/useragent >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation >> > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsteplight at gmail.com Wed May 1 17:24:50 2013 From: dsteplight at gmail.com (Darryle Steplight) Date: Wed, 1 May 2013 17:24:50 -0400 Subject: [nycphp-talk] Browser detection In-Reply-To: References: Message-ID: It looks like Detector just uses modenizer some how behind the scenes. Kind of cheating? Federico have you looked into Phantom.js yet? On Wed, May 1, 2013 at 5:08 PM, Brian O'Connor wrote: > This might be useful for you: https://github.com/dmolsen/Detector > > > On Wed, May 1, 2013 at 3:55 PM, Anthony Ferrara wrote: > >> The best way to do browser detection is to not do it. It's unreliable and >> difficult to even come close to trying it. >> >> Why do you want detection? >> >> Anthony >> >> >> On Wed, May 1, 2013 at 3:51 PM, Federico Ulfo wrote: >> >>> Hi all, how do you solve the problem of the browser detection? >>> >>> The PHP built in function get_browser() doesn't seams to work very well, >>> it's slow and inaccurate, it also need a huge browscap.ini file to be >>> loaded and updated, and looks like isn't maintained really well. >>> >>> The most accurate library I've found uses the user-agent-string.infoAPI, which isn't very fast, and it doesn't tell the device type, such as >>> iPhone, iPad, Android, etc. >>> >>> Not satisfacted by the available solutions I've decided to create a >>> library that with dependency injection loads other parser, so it's flexible >>> and accurate. The library, Sail\Useragent, is open source and available on >>> packagist: >>> https://github.com/rainphp/useragent >>> >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show-participation >>> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation >> > > > > -- > Brian O'Connor > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -- ---------------------------------------------- "May the source be with you." -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainelemental at gmail.com Wed May 1 17:17:38 2013 From: rainelemental at gmail.com (Rainelemental) Date: Wed, 1 May 2013 17:17:38 -0400 Subject: [nycphp-talk] Browser detection In-Reply-To: References: Message-ID: <697E8D8D-AA57-4C3B-8CA1-3E90F30EE36D@gmail.com> Fair enough. I need to do user analytics. From my iPhone On May 1, 2013, at 3:55 PM, Anthony Ferrara wrote: > The best way to do browser detection is to not do it. It's unreliable and difficult to even come close to trying it. > > Why do you want detection? > > Anthony > > > On Wed, May 1, 2013 at 3:51 PM, Federico Ulfo wrote: >> Hi all, how do you solve the problem of the browser detection? >> >> The PHP built in function get_browser() doesn't seams to work very well, it's slow and inaccurate, it also need a huge browscap.ini file to be loaded and updated, and looks like isn't maintained really well. >> >> The most accurate library I've found uses the user-agent-string.info API, which isn't very fast, and it doesn't tell the device type, such as iPhone, iPad, Android, etc. >> >> Not satisfacted by the available solutions I've decided to create a library that with dependency injection loads other parser, so it's flexible and accurate. The library, Sail\Useragent, is open source and available on packagist: >> https://github.com/rainphp/useragent >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainelemental at gmail.com Wed May 1 18:23:03 2013 From: rainelemental at gmail.com (Rainelemental) Date: Wed, 1 May 2013 18:23:03 -0400 Subject: [nycphp-talk] Browser detection In-Reply-To: References: Message-ID: <666DF50E-C3C3-48D1-A1EA-50D7562A9D5F@gmail.com> I can't run JS and I didn't find any good PHP solution. I googled and networked around for sometimes, it looks like browser detection is just messed up because the browser finger prints don't have a standard. So, the best solution I found is definitely the online user-agent-string.info API, which is accurate but slow and unreliable because the site is slow and often down. They also provide an ugly but working PHP library that download the browser definition file, which is faster but accurate. Although again it does not provide the platform (iPhone...). So in conclusion, I've create the sail\useragent, because I needed a solution and because it was a fun challenge! From my iPhone On May 1, 2013, at 5:24 PM, Darryle Steplight wrote: > It looks like Detector just uses modenizer some how behind the scenes. Kind of cheating? Federico have you looked into Phantom.js yet? > > > On Wed, May 1, 2013 at 5:08 PM, Brian O'Connor wrote: >> This might be useful for you: https://github.com/dmolsen/Detector >> >> >> On Wed, May 1, 2013 at 3:55 PM, Anthony Ferrara wrote: >>> The best way to do browser detection is to not do it. It's unreliable and difficult to even come close to trying it. >>> >>> Why do you want detection? >>> >>> Anthony >>> >>> >>> On Wed, May 1, 2013 at 3:51 PM, Federico Ulfo wrote: >>>> Hi all, how do you solve the problem of the browser detection? >>>> >>>> The PHP built in function get_browser() doesn't seams to work very well, it's slow and inaccurate, it also need a huge browscap.ini file to be loaded and updated, and looks like isn't maintained really well. >>>> >>>> The most accurate library I've found uses the user-agent-string.info API, which isn't very fast, and it doesn't tell the device type, such as iPhone, iPad, Android, etc. >>>> >>>> Not satisfacted by the available solutions I've decided to create a library that with dependency injection loads other parser, so it's flexible and accurate. The library, Sail\Useragent, is open source and available on packagist: >>>> https://github.com/rainphp/useragent >>>> >>>> >>>> _______________________________________________ >>>> New York PHP User Group Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> http://www.nyphp.org/show-participation >>> >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show-participation >> >> >> >> -- >> Brian O'Connor >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation > > > > -- > ---------------------------------------------- > "May the source be with you." > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Wed May 1 19:39:24 2013 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 1 May 2013 19:39:24 -0400 Subject: [nycphp-talk] Browser detection In-Reply-To: References: Message-ID: On Wed, May 1, 2013 at 3:51 PM, Federico Ulfo wrote: > Hi all, how do you solve the problem of the browser detection? > I've implemented WURFL before, but it's pretty heavy and a bit complicated to setup and maintain. http://wurfl.sourceforge.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: