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
| Option | Default | Description |
|---|---|---|
url | (required) | The address of the page to read. |
format | 'text' | 'text', 'markdown', 'html' or 'json'. |
images | false | Keep images, as links. |
timeout | 40000 | TODO: document this |