user-agent

Using UADetector To detect Robots

为君一笑 提交于 2019-12-05 09:47:32
I am testing Java user-agent detector API http://uadetector.sourceforge.net . According to the project home page the API can detect robots. But looking at the docs and playing around with the API I can't find reference to Robots. Can anyone direct me to the right direction? You can do it like this: UserAgentStringParser parser = UADetectorServiceFactory.getOnlineUpdatingParser(); ReadableUserAgent agent = parser.parse(request.getHeader("User-Agent")); UserAgentType type = agent.getUserAgentType(); // this can be ROBOT, BROWSER, etc. For more information, check this site and this example . 来源:

Distinguish between iPad and mac on iPad with iPadOs

六眼飞鱼酱① 提交于 2019-12-05 08:49:56
In iOS 13 apple changed the user-agent that iPad uses. Instead of (for example) Mozilla/5.0( iPad ; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10 it become (for example) Mozilla/5.0 ( Macintosh ; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15 My question is how can we distinguish between iPad and mac now? 来源: https://stackoverflow.com/questions/56934826/distinguish-between-ipad-and-mac-on-ipad-with-ipados

What would be the User Agent string for iPhone 8, iPhone 8 Plus and iPhone X?

霸气de小男生 提交于 2019-12-05 07:53:34
In a device detection, what would be the user agent for the new iPhone 8, iPhone 8 Plus and iPhone X? Here is the user agent string for them: Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1 Source: The iOS 11 GM firmware model number is 15A372 , which will very likely be the same as the model number of the final iOS 11. Here is a user agent from a beta version of iOS 11, which has the AppleWebKit and Safari version number. As far as I know, user agent for iPhone 8, iPhone 8 plus and iPhone X are same. To detect

PHP: detect name of android device?

余生颓废 提交于 2019-12-05 07:48:24
问题 I want to know how I can detect the Android device the visitor uses in PHP, for eg. Galaxy S. While browsing facebook from my phone, I saw: "Install Facebook on your Galaxy S and browse faster" So I viewed phpinfo(); located on my server from the same browser I used while browsing facebook and searched for "galaxy" text and got no matches. So how come it detected my device name? And how can I detect it on my PHP script? Any help would be appreciated. 回答1: Found something like this in here :-

How can I detect Android phones and Android tablets differently using the user agent header?

梦想的初衷 提交于 2019-12-05 06:25:31
For my site I need to be able to tell the difference between when an Android tablet visits and when an Android phone visits. It needs to be detected before the page is sent to the user so using JavaScript to check the screen res isn't an option. At the moment I use this to detect an android device: stripos($ua, 'android') Is there anything unique thar a tablet has in it's user agent? You can use PHP's $_SERVER['HTTP_USER_AGENT'] then case-insensitive eregi functions to look for the following, which assumes the browser developer followed Android's guidelines on user agent specification: $ua = $

Detect Lion (OS X 10.7) in javascript?

限于喜欢 提交于 2019-12-05 05:40:32
Is there a way to detect if the operating system is OS X Lion or not in Javascript? Cheers! The user agent of Safari (and also Firefox) in Lion is something like Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/534.48.3 (KHTML, like Gecko) Version/5.1 Safari/534.48.3 There is "Mac OS X 10_7_1" in it - this indicates Lion (= Mac OS 10.7). See here: http://www.whatsmyuseragent.com/ You can read the user agent string using "navigator.userAgent" http://www.quirksmode.org/js/detect.html BrowserDetect.OS I don't know its compatibility though. <- This link does use the useragent. 来源: https:

Is a unicode user agent legal inside an HTTP header?

ε祈祈猫儿з 提交于 2019-12-05 03:56:26
An application I'm maintaining loads user agents extracted from web logs into a MySQL table column using the 'latin1' charset. Occasionally, it fails to load a user agent that looks like this: Mozilla/5.0 (Iâ?; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML^C like Gecko) Version I suspect it's choking on Iâ? . I'm working to figure out if this should be supported, or if it's corruption introduced by the upstream logging system. Is this a legal user agent in a HTTP header? RFC 2616 (HTTP 1.1) says that message header contents must be "consisting of either *TEXT or combinations of

how to parse user agent string? python

断了今生、忘了曾经 提交于 2019-12-05 03:44:05
<field name="http.user_agent" showname="User-Agent: CORE/6.506.4.1 OpenCORE/2.02 (Linux;Android 2.2)\r\n" size="62" pos="542" show="CORE/6.506.4.1 OpenCORE/2.02 (Linux;Android 2.2)" value="557365722d4167656e743a20434f52452f362e3530362e342e31204f70656e434f52452f322e303220284c696e75783b416e64726f696420322e32290d0a"/> <field name="http.user_agent" showname="User-Agent: HTC Streaming Player htc_wwe / 1.0 / htc_vivo / 2.3.5\r\n" size="67" pos="570" show="HTC Streaming Player htc_wwe / 1.0 / htc_vivo / 2.3.5" value=

is there a “rails” way to redirect if mobile browser is detected?

二次信任 提交于 2019-12-05 02:38:14
I want to run a user-agent check but only on my homepage (static_controller#home) I have taken a close look at the code: http://www.arctickiwi.com/blog/mobile-enable-your-ruby-on-rails-site-for-small-screens and it seems close but it never gets tied together, its just method creation... I am open to a jquery method but would prefer ruby/rails over js. I only really care about iphone and droid... Check out this screencast . They suggest using the following for detecting a mobile device: request.user_agent =~ /Mobile|webOS/ http://detectmobilebrowsers.com/ Extremely useful for me. Joshua Dance

What HTTP User-Agent does my iOS program advertise itself as?

别等时光非礼了梦想. 提交于 2019-12-05 00:34:29
I've written an app for my podcast, Otaku no Podcast . In various parts of the app, I use NSURLConnection (fetch RSS feeds), UIWebView (display website content), AVPlayer (play MP3 audio files off our CDN), and MPMoviePlayerViewController (play video files off our CDN). Now, since all of these make HTTP requests of some sort, I'm assuming that they will advertise themselves with the standard iPhone User-agent string. (if my assumption is incorrect please let me know) This means that, based on reading my log files, I have no way of telling which of my visitors is coming in via plain old mobile