HomeDemoUsageOptionsDownloadSupport

PageBodyText fetches a page for you and hands back what a person would read on it: no markup, no menus, no scripts. Use it from jQuery with the plugin below, or call the server part yourself.

Demo

Usage

Include the script after jQuery and point it at an address. The callback gets the text of the page:

$.bodyText('https://example.com/some/article', function (text) {
    $('#article').text(text);
});

The script is a thin wrapper. All the work is done by the server part, which you can call from anything that speaks HTTP:

PageBodyText: the body text of any web page, without the page. No key, no sign-up.

Put the address after the slash, or in url=. The answer is the page as
plain text:

    https://www.pagebodytext.com/text/https://example.com/some/article
    https://www.pagebodytext.com/text?url=https://example.com/some/article

From a shell:

    curl https://www.pagebodytext.com/text/https://example.com/some/article
    curl -G https://www.pagebodytext.com/text \
        --data-urlencode 'url=https://example.com/page?a=1&b=2'

Other formats: Markdown with its headings and links,
cleaned-up HTML, or JSON with the title, the final address, the status
and the content:

    https://www.pagebodytext.com/text?format=markdown&url=https://example.com/
    https://www.pagebodytext.com/text?format=html&url=https://example.com/
    https://www.pagebodytext.com/text?format=json&url=https://example.com/
    curl -H 'Accept: application/json' \
        https://www.pagebodytext.com/text/https://example.com/

Put url last, or percent-encode it: an address written out as it is
runs to the end of the line, with its own ? and & in it.

Redirects are followed and X-Source-Url says where the page came from.
Images are left out; images=1 keeps them as links. A long page is cut
at 400 kB and X-Incomplete says so. HTML, plain text, Markdown, JSON and
XML are read; PDFs and other files are not.

Options

OptionDefaultDescription
url(required)The address of the page to read.
format'text''text', 'markdown', 'html' or 'json'.
imagesfalseKeep images, as links.
timeout40000TODO: document this

Download

Download v1.2
Minified (1.4 kB) · Source

Tested in

  • Internet Explorer 6, 7, 8
  • Firefox 3.0 – 3.6
  • Safari 4, 5
  • Chrome 9
  • Opera 10.6

Changelog

  • 1.2 2011-03-02: format option; images option.
  • 1.1 2010-11-19: follows redirects.
  • 1.0.1 2010-08-07: fixed IE6 caching the answer.
  • 1.0 2010-07-30: first release.

Requires

jQuery 1.3.2 or newer. Works with 1.5.