Skip to content

πŸŒπŸ”€πŸ“° Converts a webpage article into other formats, like PDF, markdown, JSON, plain text...

License

Notifications You must be signed in to change notification settings

DivineOmega/web-article-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒπŸ”€πŸ“° Web Article Formatter

StyleCI

The web article formatter can extract and convert an article from a webpage into a number of other formats, including PDF, markdown, JSON, plain text and more.

Installation

You can install Web Article Formatter via Composer. Just run the following command.

composer require divineomega/web-article-formatter

Usage

To retrieve a web page article and convert it into a different format, first create a new WebArticleFormatter passing it the URL of the web page. Then, simply call the formatter's get method, passing it a valid format constant.

A list of all format constants can be found in the Format class.

$formatter = new WebArticleFormatter($url);

echo $formatter->get(Format::PLAINTEXT);
echo $formatter->get(Format::MARKDOWN);
echo $formatter->get(Format::HTML);
echo $formatter->get(Format::JSON);

file_put_contents('article.pdf', $formatter->get(Format::PDF));

About

πŸŒπŸ”€πŸ“° Converts a webpage article into other formats, like PDF, markdown, JSON, plain text...

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages