printfuck / xExtension-Readable

A FreshRSS extension to fetch article content with Readability or Mercury
GNU Affero General Public License v3.0
51 stars 9 forks source link

Unexpected token #7

Closed sean89503 closed 2 months ago

sean89503 commented 1 year ago

I cant seem to get the extension to work i get "Unexpected token" here is an output of running curl -XPOST http://read:3000/ -H "Content-Type: application/json" -d'("url": "https://www.androidcentral.com/accessories/audio/amazon-echo-frames-carrera-eyewear-reveal")'

`<!DOCTYPE html>

Error
SyntaxError: Unexpected token ( in JSON at position 0
   at JSON.parse (<anonymous>)
   at createStrictSyntaxError (/application/node_modules/body-parser/lib/types/json.js:169:10)
   at parse (/application/node_modules/body-parser/lib/types/json.js:86:15)
   at /application/node_modules/body-parser/lib/read.js:128:18
   at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
   at invokeCallback (/application/node_modules/raw-body/index.js:238:16)
   at done (/application/node_modules/raw-body/index.js:227:7)
   at IncomingMessage.onEnd (/application/node_modules/raw-body/index.js:287:7)
   at IncomingMessage.emit (node:events:514:28)
   at endReadableNT (node:internal/streams/readable:1359:12)
`
printfuck commented 1 year ago

Hi,

It should work with:

curl -H "Content-Type: application/json" -d'{"url": "https://www.androidcentral.com/accessories/audio/amazon-echo-frames-carrera-eyewear-reveal"}' http://read:3000

Using {} instead of ().

sean89503 commented 1 year ago

that worked from the CMD but in freshRSS i get (see picture) image image

printfuck commented 2 months ago

Sorry for not reacting, but I came around to try the same feed with the extension as of now. But I don't have this problem. Also I don't have the override_content row, that you probably added somehow. I'd suggest you use the extension as it is or to try a bit more debugging of your own.

hf, gl