postlight / parser

📜 Extract meaningful content from the chaos of a web page
https://reader.postlight.com
Apache License 2.0
5.46k stars 446 forks source link

How to install self-hosted Mercury AMP Converter? #444

Closed spinnaker1 closed 5 years ago

spinnaker1 commented 5 years ago

I'm sorry, if it's against the rules, but I'm desperately looking for a documentation (or some help) on how to setup a self-hosted "Mercury AMP converter" like: https://mercury.postlight.com/amp?url=http://www.example.com/sample-article.html

If there is any tutorial, documentation or maybe someone can help a Linux and selfhost enthusiast w/o coding experience.

Are there any plans providing a docker image, maybe also for RaspberryPi arm platform?

mtashley commented 5 years ago

Hi @spinnaker1,

A great place to get started would be to explore the internals of the ./preview script packaged with mercury-parser. See: Step 4: Content Extraction

Once you've got the project downloaded and installed, you can navigate to the project directory and run urls against the script:

./preview http://www.newyorker.com/tech/elements/hacking-cryptography-and-the-countdown-to-quantum-computing

It'll take a few moments to build and then a preview will be generated along w/ the JSON output.

63292805-630be280-c27b-11e9-9ea2-d26c6a1eb633

From there, it's basically just a matter of styling & formatting to create a custom, self-hosted version.


Are there any plans providing a docker image? Currently there are no plans to dockerize, but it's definitely a good idea if you plan to use mercury as a micro-service.

RaspberryPi arm platform? No plans for RaspberryPi at the moment, but we'd be interested to see what the community might come up with in this regard.