Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Tuesday, June 3, 2014

Hypertext Browsing

I tend to browse the web using Firefox with some basic plugins, which probably is true for most people (Chrome, Safari, etc...).  It's overkill for a lot of things though.  A lot of the time, all I really need is a way to enter a URL, render some text, search for some text, follow links, and possibly enter text into forms.  All of these can be done with a slightly simpler browser, w3m.

If you are resource constrained, you prefer working strictly with text, or you don't have access to a graphics environment, w3m can come in handy.  The footprint is a few orders of magnitude less than the graphical variants, and it's meant for keyboard navigation.

The motions are probably familiar to anyone who's used Vi/Vim before.

<h>- left
<j>- down
<k>- up
<l>- right
<w>- next word
<^>- line start
<$>- line end

Directional keys can also be used.  Navigating links and input fields is generally the same as the graphical browsers.

<tab>- next field
<s-tab>- previous field

Instead of the mouse, w3m gives a menu for links, which can be slightly faster than using a mouse (see Fitts' Law).

<esc-m>- link list (move)
<esc-l>- link list (follow)

Another easy way to navigate is searching for text.  Again, Vi/Vim users will probably recognize the default key bindings.

</>- search forward
<?>- search backward

Last, to open new URLs and tabs...

<U>- open URL
<T>- new tab

There are more complex combinations, but the above should be a good start.  The full set of navigation and configuration options can be found in the man page as well as the help screen (<H>).

Putting it all together...


One of the things I've found w3m is good for is as a basic interface for things that have a form of HTTP/HTML API.


It's admittedly limited, depending on the protocol or features sites you try to browse rely on.  Support for more recent protocols (SPDY, HTML5, AJAX, etc...) is decidedly lacking.

Although, on the development side, it's also useful for a number of things like navigating doxygen/javadoc, parsing jhat output, and even browsing wikipedia.


It's also useful to work with from the command line.

~ watch -n 10 w3m http://www.wrh.noaa.gov/sew -dump

I combine it with other things like tmux, mutt, vim and emacs which makes it a little more useful, but the above are some of the basics.

Downloads, documentation, etc... can be found on w3m's homepage for anyone curious.

Wednesday, January 25, 2012

Sony PRS

I bought a Sony PRS a while ago, which I've been using a decent amount.  Managing books was a bit cumbersome though.  Copying anything onto it normally needs a computer, a USB connection, and management software.  Thankfully, I was able to simplify it a bit.

The PRS has a built-in 802.11g radio, so obviously data was already being transmitted over ethernet.  It also has a web browser, so again it obviously supported HTTP.  Normally the browser only supports text/html though, which precluded a lot of stuff I actually wanted it for.

PRS+ helped fix this.  It implements a lot of the things I thought were missing from the stock firmware; specifically non-html MIME type support.  Actually it integrates this with the stock browser, which even made a user friendly interface possible.  Authentication and encrypted HTTP unfortunately aren't implemented, which could make using it outside of home a bit impractical, but downloading from sites like project gutenberg normally doesn't need either.

Finally, to make everything I wanted to be able to read available via HTTP, I setup an apache webserver with mod_autoindex.  The mod_autoindex module isn't completely necessary,  but it gives nice HTML listings for directories which makes things a bit more user friendly.

Et, voila...




A big thank you to the PRS+ developers, otherwise I would have been stuck.  For anyone curious, it adds a lot over the stock firmware (file browser, screenshots, etc...).