top | item 863284

"How do I set the User-Agent string in Java?" - L. Page (1996)

173 points| frisco | 16 years ago |guyro.typepad.com | reply

39 comments

order
[+] donw|16 years ago|reply
Why didn't he just Googl... er... uh... nevermind.
[+] wlievens|16 years ago|reply
This is magnificent. I imagine decades from now, web archeology will be a true academic discipline.
[+] pavel_lishin|16 years ago|reply
You should read "A Deepness In The Sky" and "A Fire Upon The Deep"; the topic is actually covered fairly well.
[+] borism|16 years ago|reply
yes, but allow me to point out that Usenet is not exactly Web.
[+] mynameishere|16 years ago|reply
Can't blame him for not googling it himself.
[+] huherto|16 years ago|reply
This reminds me of Doc Brown in 1955 before he invented his time machine. (In Back to the future)
[+] sofal|16 years ago|reply
I imagine his bot has undergone a couple of revisions since then.
[+] swombat|16 years ago|reply
I wonder if it still runs under Java 1.0.
[+] sown|16 years ago|reply
The internet has a neat ability to remember things.
[+] yupbank|16 years ago|reply
with the eclipse u'll never worry about such question~
[+] technomancy|16 years ago|reply
The hilarious bit is that they dropped Java for Python, probably due to the massive levels of frustration encountered when trying to do simple things like this.
[+] litewulf|16 years ago|reply
In practice, almost all core code is C++/Java (vast majority is C++, though its slowly shifting), with Python relegated mainly to scripting glue.
[+] axod|16 years ago|reply
Setting a user-agent isn't exactly a core language thing. HTTP is an add-on library, of which there are many to choose from.

I know you saw the title and thought "ahahaha easy time to bash Java again", but it's really ignorant to do so.

[+] qw|16 years ago|reply
It was simple. This is the code he had to use (assuming he used URLConnection)

connection.setRequestProperty ("User-agent", "GoogleBot/0.01");

I had never done this before and found it out by looking at the javadoc. I don't see how switching to Python would have made this easier.