Curl, 17 years old today
daniel.haxx.se
daniel.haxx.se
So, so true. Thanks, curl.
It's perfectly acceptable for Websites to include, and even require the use of, JavaScript. It's also perfectly acceptable to offer a JavaScript client for your API. In fact, you pretty much have to do that if you want your Website to work with the API anyway. What's not OK is for an API to require downloading and using additional JavaScript while the API is being used.
As a contrived (and somewhat ludicrous) example, let's say that I queried "http://foo.com/bars" for some kind of collection. It's OK to return the collection. It's even OK to use an HTTP redirect if the collection actually resides elsewhere: HTTP 302, perhaps, with a Location of "http://foo.com.bazes". What's not OK is to return a line of JavaScript reading "window.location = 'http://foo.com/bazes';" which might work for the browser, but wouldn't work for most other clients.
/s
Just think about how many engineer-hours Twitter flushed with that silly #! kludge – and then when they switched back, saw an 80% improvement in page load time.
No hours were wasted, and they didn't really switch back. They're just using HTML5's History API on browsers that support it now. Essentially the same mechanism under the hood, just prettier URLs for it.
Now, here's what a tweet looks like without JavaScript enabled:
https://www.dropbox.com/s/me7kinvje7ly781/Screenshot%202015-...
Here's what it looks with JavaScript enabled:
https://www.dropbox.com/s/04pjdlkuht6t2ja/Screenshot%202015-...
(The main difference would be that things like the search & menus are either interactive controls or simple links to basic HTML forms depending whether JavaScript loads)
During the hashbang era you couldn't use a page without a full rendering ending. Now, however, all of the content is available with fairly rich markup:
https://redbot.org/?uri=https%3A%2F%2Ftwitter.com%2Facdha%2F...
FUD. I develop HTML5 gambling for a living and this anti-javascript sentiment on HN is getting really tiresome. You honestly sound like a bunch of old people, complaining that a PC isn't a typewriter or a fountain pen.
Yeah your fountain pen doesn't require power and it writes your name really well, but that doesn't mean that the PC isn't better.
Client side rendering means you will have to test in all browsers, writing android apps means you have to test on a lot of units.
If you want to know why this is a good idea, you should start using something like getsentry.com or errorception.com to record your JavaScript errors. That won't tell you who couldn't execute JavaScript at all but it'll show how many times something didn't load due to a flaky ISP, adware, buggy anti-virus, odd browser settings, etc. With progressive enhancement, those people still have a reasonable chance of at least seeing the content on the page. With a pure JS approach, they're only going to see a blank and will probably be heading over to a competitor whose site degrades well.
(Note that this is only the question of the site working at all. In most cases, the progressive site will also render considerably faster – Twitter found an 80% improvement! – since the pure-JS approach breaks the browser's prefetch optimizations and requires much more work to achieve comparable performance)
I've been using websites since the early 90s and this pro-single-page sentiment is getting really tiresome. You are breaking the web. You are destroying users' security.
Sure, there are plenty of reasons to use JavaScript, and plenty of places where it's appropriate. It probably is a good idea for games and so forth. But requiring users to load and execute constantly-changing code from across the web in order to read a page or submit a form is in-friggin-sane.
Some one else pointed out that it'd be nice if browsers offered more support for things that certain types of developers clearly want to do. I completely agree; it'd definitely be nice to take advantage of many of the technologies which currently exist to do more, in a more structured way. But requiring code execution in order to read data is madness.
[1] http://nerds.airbnb.com/isomorphic-javascript-future-web-app...
bonus, it makes it easier to write your app in other languages or for other platforms since the web server really is a server and the front-end is just a client.
Breaking away from the DOM but keeping the ability to remotely load code and static assets would be the best of both worlds. Something like Google Maps is an application, not a document. Why are we rendering it with a document renderer? Why are we styling it with CSS, which is again, document-oriented? The good part about single page apps is that they deliver a package of code, then are able to keep local state and communicate with the server over a stateless protocol. Oh, and the current breed runs on a platform (browsers) that is installed on every PC and mobile device. Browsers just need a better format for delivering packages of code and better support for these than "manipulate the DOM".
I want to make a library that reads the curl command (and maybe request syntax?) and outputs a function that will do that command.
alias wget='echo "How dare you." && curl -O'
brew rm wget
Happy birthday.When I started my work on httpget in 1996, I didn't know about wget and I didn't become aware of it until several years later....
now days we use curl/wget for web dev it seems? probably used it for the same thing back then but I also image that lots of people just used their own ad-hoc scripts or whatever; i wish i had firsthand knowledge of that.
i used wget to download copies of websites when i found one that was mostly documents/images rather than webapps.
I loved wget for that. what are your options? Mine was always -r -p -k -nH --cut-dirs=2 -np
http://www.rfc-base.org/txt/rfc-1945.txt
HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification reflects common usage of the protocol referred to as "HTTP/1.0".
Basic HTTP as defined in 1992 had GET, PUT, HEAD, POST, LINK, TEXTSEARCH, CHECKIN, etc.: http://www.w3.org/Protocols/HTTP/Methods.html
More generic info: http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
I can't remember what I eventually did but I do remember discovering lynx -dump, so thanks for the reminder!
lynx -head -dump http://httpbin.org
Your version dumps the body as well, which is hard to parse if you just need the headers.On another note: Thanks for curl - it's always high up in my charts somehow. Right now #2 in
history 0 | awk '{print $2}' | sort | uniq -c | sort -n -r | head -n 20 $ telnet 80
GET /
It should be noted that the above isn't a strict HTTP request header, it's missing quite a lot of detail, but it works as an example.HTTP/1.1 wasn't around until 1996 so back then Host: headers weren't even "optional". They simply didn't exist yet.
Copyright 1995-2009, Gisle Aas
Copyright 1995, Martijn Koster
Round about then I wrote something similar to WWW::Mechanize in order to automate access to the Orange Web-SMS gateway, which had an inconveniently deep login procedure.
[1] http://search.cpan.org/~ether/libwww-perl/ (see changelog)
For PHP people, curl_multi_exec is the new event loop.
This cannot be true by a long shot. Or am I missing something?
This does not seem to explain the 1 billion users figure.
Just because Wordpress, which is a blog platform, uses libcurl for something you didn't even state (probably some outbound http stuff), doesn't mean it uses it to process most of the incoming requests for the millions of users.
We don't say Solitare is the most successful game ever just because it's installed with every copy of Windows.
Well I had to check, but this is not true at all:
$ nc -l -p 9999
GET / HTTP/1.1
User-Agent: Wget/1.15 (linux-gnu)
Accept: */*
Host: localhost:9999
Connection: Keep-Alive
Also wget can recursively mirror webpages and there are nice options to carefully select contents you want to download. It's quite dated though, I wish it could use an external downloader (like aria2) and only do the walking and converting links part itself.I use it all the time even as the down loader for ArchLinux's pacman (package manager).
http://www.archiveteam.org/index.php?title=Wget_with_WARC_ou...
http://www.archiveteam.org/index.php?title=The_WARC_Ecosyste...
I stumbled upon this info when writing a redirector app recently. You're right, I should have verified that it was true.
Ha! Good to know :)