Everyone probably knows how page-by-page navigation is done in Google Reader. Initially, about as many unread news are loaded as it is on the screen, and then, as the page scrolls down, the rest of the news is loaded asynchronously.
What is such a good system? Perhaps the fact that it is transparent and invisible: the user moves through the pages for nothing doing this, just reading the news in his rss reader. There are, of course, this approach and disadvantages, but this is not the point.
So, tonight I accidentally stumbled upon a plugin for firefox, which allows you to make similar page-by-page navigation for almost any site, moreover, it initially contains settings for many well-known sites: Digg, Google, Wikipedia, etc.
')
This miracle is called AutoPager, and you can put it
here .
The principle of its operation is very simple. When the page scrolls down, AutoPager finds a link to the next page, downloads it, throws out all unnecessary (or leaves everything you need), and inserts the result into the current page. Vitoge effect is obtained as in Google Reader.
The user has the ability to disable such navigation at any time by simply clicking on the icon in the browser's status bar, but most importantly, it is possible to configure the plugin so that it will work with any site.
To do this, you must specify the settings:
- Site URL (can be regexp'om)
- xpath for the link to the next page
- xpath for elements that are dynamically added to the current page
- xpath for the container in which the elements from the previous paragraph are inserted
This is the easiest setting option, there are additional options. And there is also a wizard that allows you to set the settings simply by clicking on the page elements.
Again, there is a database of settings for different sites added by other users, and it seems to be updated regularly.
And for a snack setting, which I did for Habr (I have already submitted it to the repository, but it has not yet been reviewed):
<autopager>
<site><urlPattern>http://.*\.?habrahabr\.ru/.*</urlPattern>
<guid>C7CFB529-8F24-D4F8-F42F-894E-FDB0-D91B</guid>
<owner>destel</owner>
<urlIsRegex>true</urlIsRegex>
<published>true</published>
<contentXPath>//div[@id="main-content"]/div[@class="hentry" or @class="page-nav"]</contentXPath>
<testLink>http://habrahabr.ru/</testLink>
<linkXPath>//a[@class='next']</linkXPath>
<desc>http://habrahabr.ru/</desc>
</site>
</autopager>
You can add it this way: copy the code to the clipboard, right-click on the icon in the status bar, select “manage setting”, click on the “Import” button and select “Import from Clipboard” in the menu that appears.
Upd: Settings for the habr have already been added to the publicly accessible online database. Now, so that they pick up, you need to click on the icon in the status bar, select “Import from URL” in the context menu and click OK.