user-agent

Java user agent parser

好久不见. 提交于 2019-12-11 02:54:53
问题 I was searching for a good Java USerAgent parser and I found http://user-agent-utils.java.net/ How can I test it to see if I get the correct results? 回答1: You can get a look at UADetector, it seems better supported than user-agent-utils (up to date parser, actively developed, monthly releases) 回答2: One of they official tests can be seen here 来源: https://stackoverflow.com/questions/7659508/java-user-agent-parser

.htaccess allow only from Chrome, Opera, Mozilla, Safari, redirect from others

£可爱£侵袭症+ 提交于 2019-12-11 00:33:32
问题 I want to configure redirect if the user doesn't use Chrome, Safari, Opera or Mozilla. For inverse problem (if I don't want Chrome etc.) there is a solution: RewriteCond %{HTTP_USER_AGENT} Chrome RewriteRule ^abcd.html$ chrome.html [NC,L] RewriteCond %{HTTP_USER_AGENT} Safari RewriteRule ^abcd.html$ safari.html [NC,L] Adding ! before doesn't work 回答1: Negation is done using the ! operator. Using the [NC] flag will also discard strings like chrome , chRome etc: RewriteCond %{HTTP_USER_AGENT}

User agent header - abbreviation for mysql storing

落花浮王杯 提交于 2019-12-10 19:44:18
问题 According to this thread, and specially this post: https://stackoverflow.com/a/6595973/1125465, Microsoft as always shows off. The size of user agent, can be really, really huge. I'm working on a little visitors library in php, and I want to store user agent information. I cannot decide on the data type and length. So my question is: have you got any ideas, on how to shorten the user agent, to some "normal" size? (for example 256 chars) . Note: Developers use user agents for detecting the

What is MATM in my User-agent

给你一囗甜甜゛ 提交于 2019-12-10 19:12:44
问题 The most used IE User-agent's in my stats are: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; MATM) Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0) What does the MATM stand for? 回答1: MATM is a codename for the hardware, one of several by the same vendor: useragent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; MATMJS) vendor: TS - useragent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/7.0; MATM) vendor:

How to detect web crawlers for SEO, using Express?

…衆ロ難τιáo~ 提交于 2019-12-10 19:10:24
问题 I've been searching for npm packages but they all seem unmaintained and rely on the outdated user-agent databases. Is there a reliable and up-to-date package out there that helps me detect crawlers? (mostly from Google, Facebook,... for SEO) or if there's no packages, can I write it myself? (probably based on an up-to-date user-agent database) To be clearer, I'm trying to make an isomorphic/universal React website and I want it to be indexed by search engines and its title/meta data can be

User-Agent in HTTP requests, Ruby

房东的猫 提交于 2019-12-10 15:32:59
问题 I'm pretty new to Ruby. I've tried looking over the online documentation, but I haven't found anything that quite works. I'd like to include a User-Agent in the following HTTP requests, bot get_response() and get(). Can someone point me in the right direction? # Preliminary check that Proggit is up check = Net::HTTP.get_response(URI.parse(proggit_url)) if check.code != "200" puts "Error contacting Proggit" return end # Attempt to get the json response = Net::HTTP.get(URI.parse(proggit_url))

How to get a Windows Phone 7's useragent string?

為{幸葍}努か 提交于 2019-12-10 14:20:58
问题 I need to get a phone's user agent string, but I haven't found anything in the API that allows this. I've come across the following two blog posts describing the format of the user agent string: http://blogs.msdn.com/b/iemobile/archive/2010/03/25/ladies-and-gentlemen-please-welcome-the-ie-mobile-user-agent-string.aspx http://madskristensen.net/post/Windows-Phone-7-user-agents.aspx But I haven't found a method that can return the user agent. Has anyone been able to do this successfully? 回答1:

how to set user agent for get_headers PHP function

六月ゝ 毕业季﹏ 提交于 2019-12-10 13:26:23
问题 I know It's easy to set user agent for curl but my code is based on get_headers, by default get_headers user agent is empty. thanks for any help. 回答1: Maybe this? ini_set('user_agent', 'Mozilla/5.0'); 回答2: get_headers only specifies the data sent by the server to the client (in this case, PHP), it doesn't specify request headers. If you're trying to find the user agent the get_headers request was made with, you'll have to use: ini_get('user_agent'); For more documentation see the links below:

How can I fix impaired functionality caused by disallowed useragent?

梦想与她 提交于 2019-12-10 12:56:45
问题 I'm building a web browser an recently I came across an error while trying to login using my Google account on a website. This is strange because I checked the user agent of my app and Safari's and they are both identical. Any suggestions? UPDATE The WKWebView is nested 3 levels deep inside a tree of custom UIViews. Here's the initialization code: _webView = [[WKWebView alloc] init]; _webView.allowsBackForwardNavigationGestures = NO; _webView.allowsLinkPreview = NO; _webView

RESTful API: require user agent string?

我的未来我决定 提交于 2019-12-10 12:39:59
问题 My team has a web site with a RESTful API. We're is working on load testing it, so we've built a small console app to hammer it with requests. This console app does not set the user agent string, and that is causing an error in our API because it is a required field in our database. So, should I make the API extra robust and simply use a default string (i.e. "unknown") if a user agent isn't included in the request? Or, should I return a 400 Bad Request response in this situation? I know