arouel / uadetector

UADetector is a library to identify over 190 different desktop and mobile browsers and 130 other User-Agents like feed readers, email clients and multimedia players. In addition, even more than 400 robots like BingBot, Googlebot or Yahoo Bot can be identified.
http://uadetector.sourceforge.net/
Apache License 2.0
246 stars 100 forks source link

DTD location for user agent list configurable to support udger.com #93 #109

Closed mdlnr closed 9 years ago

buildhive commented 9 years ago

André Rouél » uadetector #215 FAILURE Looks like there's a problem with this pull request (what's this?)

HaraldWalker commented 9 years ago

Any chance of seeing this merged?

jgangemi commented 9 years ago

:+1:

HaraldWalker commented 9 years ago

An update to the UADetectorServiceFactory with the option to set the access key (or all 3 urls) or point to a local version of the database (so people can use the free version) would be good since that's the documented way of using this library.

HaraldWalker commented 9 years ago

I thought the old and new XML database are compatible but since the DTD changed there are obviously not. When creating a CachingXmlDataStore I am getting an error when using the new udger xml in combination with the bundled old version as fallback. Error: unable to resolve remote entity, systemId = http://user-agent-string.info/rpc/uasxmldata.dtd So, one also has to create a new fallback using the new xml and here then also use http://data.udger.com/uasxmldata_old.dtd and not DEFAULT_DATA_DEF_URL as defined in DataStore.

arouel commented 9 years ago

@HaraldWalker How sad. I don't know how we should proceed with this library without a free database. I'm not very interested in the udger.com offering.

HaraldWalker commented 9 years ago

I completely understand. But a lot of projects use this library and those are now stranded. Would be good to get a least one version out that can work with udger.com. I just got it working by using tjacoby's branch and a special UdgerUADetectorServiceFactory. I could try to make a generic version of that and contribute it. But we still have the code formatting issue and various failing unit tests.

jgangemi commented 9 years ago

what about the suggestion in #96 to use http://browscap.org/ data. it would require a new service factory (?) though.

HaraldWalker commented 9 years ago

@jgangemi because the domain model of UADetector is bound tightly to the database of user-agent-string.info/udger. We are not completely dependent on the regex database of udget.com but any alternative would have to follow the same structure in the data model to be compatible.

arouel commented 9 years ago

@HaraldWalker Could you provide a Pull Request with all necessary changes? I would go through the broken test cases then and fix them.

HaraldWalker commented 9 years ago

@before I will try to find some time for that.

HaraldWalker commented 9 years ago

Not sure we need this pull request. The old DTD is invalid anyhow and don't think the user really needs to be able to provide the url for the DTD. Since we are bound tightly to the structure of the user-agent database, any database should follow the uasxmldata_old definition. So we can just use http://data.udger.com/uasxmldata_old.dtd as the new default value of DEFAULT_DATA_DEF_URL and then make the bundled old uas.xml compatible by changing it's DTD reference.