Gowee / readability-bot

A Telegram bot that makes webpages "readable" (Instant View & Inline Mode)
https://t.me/ReadabBot
29 stars 7 forks source link

Not able to run locally - 404 on /api/readability #4

Closed dmitrym0 closed 1 year ago

dmitrym0 commented 1 year ago

Hello folks,

I tried to run this locally:

  1. npm install
  2. npm run dev

However when I try to hit http://localhost:5000/api/readability?url=http%3A%2F%2Fgoogle.com in the browser I get a 404. What am I missing?

Gowee commented 1 year ago

Hello.

The (somewhat misleading) package.json is generated automatically by Svelte for the front-end web page.

To spin up the whole app with API service, npx vercel dev.

And if you are gonna run a Telegram bot, do not forget to set the webhook callback URL to your Vercel app.

Thanks for your feedback, I will update the README to doc this procedure.

dmitrym0 commented 1 year ago

@Gowee appreciate it!

My goal was to try latest Mozilla/readability because readability-bot results differ from the actual Firefox reader mode. I bumped it up to 0.4.4 and it's still differs from what "reader mode" shows. Any idea why that might be?

Gowee commented 1 year ago

I am not sure what the difference is.

If you mean the webpage style, it is set separately, irrelevant to readability-js. If you mean the webpage content/element, I have no idea. https://github.com/mozilla/readability/issues/472#issuecomment-406308538 suggests that the standalone version might not be exactly the same as the one used in Firefox.

dmitrym0 commented 1 year ago

Yeah, I'm talking about web page content.

Here's the reader mode in Firefox 113:

image

and here's the bot:

image

Interestingly, a few days days ago when I captured the PDF (using readability-bot) this is what it looked like:

image

Here's the URL: https://medium.com/awesome-cloud/aws-difference-between-amazon-aurora-and-amazon-rds-comparison-aws-aurora-vs-aws-rds-databases-60a69dbec41f

I wonder if maybe medium is serving something different based on the User-agent.

Gowee commented 1 year ago

Closing. I cannot help more. And it is actually out of the scope of the project. Thanks for your feedback again.