Skip to content
This repository was archived by the owner on Sep 25, 2022. It is now read-only.

mandrasch/screenreadthis-api-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archived repository

Functionality was moved into SvelteKit: https://github.com/mandrasch/screenreadthis


ScreenreadThis! API server

Retrieve the accessibility tree for URLs via simple API call, made possible via Accessibility.snapshot() by Puppeteer. Server implemented via express.

Created for ScreenreadThis!-experiment.

API usage

  • Call via /?getA11yTree?url=<ENCODED_URL>
  • Example request: /getA11yTree?url=https%3A%2F%2Fwww.a11yproject.com%2F

Demo: https://screenreadthis-api-server.onrender.com/getA11yTree?url=https%3A%2F%2Fwww.a11yproject.com%2F (can take a minute or two)

! This demo runs on a limited resources cloud hosting, only use it for testing please. !

Host your own (NodeJS)

You can host this API server yourself:

# supervisor error output
 at processTicksAndRejections (node:internal/process/task_queues:83:21)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at Socket.emit (node:events:539:35)
    at Socket.onend (node:readline:277:10)
    at Interface.close (node:readline:586:8)
    at Interface.emit (node:events:539:35)
    at Interface.<anonymous> (/home/ploi/screenreadthis-api-server.mandrasch.eu/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:278:24)
    at onClose (/home/ploi/screenreadthis-api-server.mandrasch.eu/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:290:20)
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
/home/ploi/screenreadthis-api-server.mandrasch.eu/node_modules/puppeteer/.local-chromium/linux-1036745/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory
Error: Failed to launch the browser process!

Local development

npm install
npm run dev

Run production server

# this will call NODE_ENV=production node server.js
npm start

Imprint and Privacy

https://screenreadthis-api-server.onrender.com is hosted on european Cloud Instances via render.com, see https://render.com/privacy for more information. Contact information / imprint: https://matthias-andrasch.eu/blog/impressum-datenschutz/

License

Feel free to fork / re-use this for your own purpose! My own source code is provided as CC0/Public Domain, see package.json for open source packages used and their respective licenses.

About

Get accessibility tree for URL via simple API call, made possible via Accessibility.snapshot() by Puppeteer + Express

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors