user-agent

Code Golf: What's the quickest way to determine if I'm using IE?

I run across this constantly, render some HTML if the browser is IE and some other if FFX (or mac, opera, etc). This is what I use (pardon the missing underscores) if(ereg("msie", strtolower($SERVER['HTTPUSERAGENT']))) { } Anyone know a shorter way? (I use PHP but, just for the heck of it, i'd love to see non-PHP code as well who kno...

Fetch a Wikipedia article with Python

I try to fetch a Wikipedia article with Phython's urllib: f = urllib.urlopen("http://en.wikipedia.org/w/index.php?title=Albert_Einstein&printable=yes") s = f.read() f.close() However instead of the html page I get the following response: Error - Wikimedia Foundation: Request: GET http://en.wikipedia.org/w/index.php?tit...

IE7 detected as IE6 on Vista...Why?

I have two vista Business machines. I have IE 7 installed on both. On my first machine (Computer1) if I go to this site (http://www.quirksmode.org/js/detect.html), it says I am using "Explorer 6 on Windows". If I use Computer2 with Vista Business and IE7, it says I am using "Explorer 7 on Windows". Here is a screen capture. The same...

Operating System from User-Agent HTTP Header

Is there a good, up-to-date listing anywhere that maps User-Agent HTTP Header strings --> operating systems? ...

ie useragent wxWidgets

Hello, Im currently using ie as an active x com thing on wxWidgets and was wanting to know if there is any easy way to change the user agent that will always work. Atm im changing the header but this only works when i manually load the link (i.e. call setUrl) ...

Throttle traffic in Apache based on User-Agent

We are running Apache (IBM HTTP Server 6.0.2.0) in front of WebSphere 6.0 on linux. We are getting excessive traffic from a specific User-Agent from varying IP addresses. We do not want to block the User-Agent or IP addresses, but would like to slow them down a bit. Best scenario for us would be to use out of the box Apache config op...

How to detect that a feed reader accesses my page?

I would like to serve a different content from a single URL depending on whether the user is a browser or a RSS reader (hence avoiding an example.com/feed URL). Thus www.example.com/posts will return an (X)HTML page to a browser and an RSS feed to a feed reader. What the architecturally most appropriate way of accomplishing this? PS Ho...

Applet User-agent

Hello! This is a simple question, but I didn´t found any documentation about this. When an applet makes a request, how is the user agent of the request. I want to know the applet user-agent expression to detect if a request comes from an applet. I make two test, with IE7 and Firefox 3.0.5 with JDK 1.6.0_03 and the user agent was "Mozil...

Keeping same session with different user-agents

Is there a way to use the same session on different user-agents. I have a flash app that is generating a new session id on posting data to myHandler.ashx ( same happens on aspx ). Am i missing a trick here? ...

How to Set User-Agents in an HttpRequest (Unit Testing)

I've got a method that takes in an HttpRequest object and performs differently based on what User Agent is set. I'm trying to unit test it and am having a heck of a time tracking down how to set the User Agent string. I've tried the raw HttpRequest object and a variety of other objects that eventually yield it to no avail. Does anyone...

With Apache httpd, how do I configure no caching for a given UserAgent?

I have Apache HTTPD configured to add a cache header to requests for most static content: ExpiresActive On ExpiresDefault "access plus 1 year" # Force JNLP and BSH files to expire immediately so updates are checked for # and seen (We need this so we see changes in the dynamic content in both) ExpiresByType application/x-java-jnlp-file ...

PHP Sessions + Useragent with salt

Hi, It keeps running in my mind the last couple of days, but I read some articles about how to make your PHP sessions more secure. Almost all of these articles say that you need to save the useragent in the session WITH an additional salt. Something like this: $fingerprint = md5('SECRET-SALT'.$_SERVER['HTTP_USER_AGENT']); The salt wo...

How big can a user agent string get?

If you were going to store a user agent in a database, how large would you accomdate for? I found this technet article which recommends keeping UA under 200. It doesn't look like this is defined in the HTTP specification at least not that I found. My UA is already 149 characters, and it seems like each version of .net will be adding to ...

How can I talk to UniProt over HTTP in Python?

I'm trying to get some results from UniProt, which is a protein database (details are not important). I'm trying to use some script that translates from one kind of ID to another. I was able to do this manually on the browser, but could not do it in Python. In http://www.uniprot.org/faq/28 there are some sample scripts. I tried the Per...

Mobile detection using Javascript

Is there a way to detect mobile devices using Javascript? Also, I researched that there are such an XML which contains user-agents that could help to identify the mobile handsets. Many thanks. -V2 ...

What is a user-agent?

I see many web development tools that let me change this thing called the "user-agent". What it it? ...

Changing user agent on urllib2.urlopen

How can I download a webpage with a user agent other than the default one on urllib2.urlopen? ...

A User Agent that says just "Mozilla/4.0" is a bot, right?

I'm getting several requests in web apps that are basically wrong in ways my code shouldn't be generating... Mainly it's requests to .ashx without any GET parameters specified. The user agent is "Mozilla/4.0" (nothing more than that) The IPs vary from day to day. This is a bot, right? Thanks! ...

Best regex pattern for matching non SP1 IE6 in user agent string?

I needed some code to match all IE6 versions that are not SP1 (part of Windows XP SP2, confusing eh). This is to turn gzip off for versions of IE that do not handle it properly. The best I have come up with is: MSIE [1-6]\.(?!.*?SV1) Does anyone have a better pattern? What the regex above does is basically do a lookahead to make sur...

ASP.net not generating javascript for some User Agents

***************Edit 2***************** I figured out the problem... But I don't like the implications. I was testing our iPhone targeted mobile application earlier and using a plugin to mask Firefox's User Agent String as an iPhone. .Net was infact NOT generating the required code for post backs based on that piece of information alone...