Skip to content

This is a sample for a very simple implementation using OpenIntegration

License

Notifications You must be signed in to change notification settings

paperlesspaper/openintegration-xkcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenPaper Integration Sample

This is a sample for a very simple implementation using the OpenIntegration of paperlesspaper.

Overview

This project renders a minimal daily XKCD view that can be used in the paperlesspaper project.

How to use

Inside the app select New Image > Custom Integration and enter the url: https://openintegration-dailyxkcd-gamma.vercel.app/config.json

Key files

  • render.html: Static rendering template used for the display.
  • api/xkcd.js: Serverless endpoint that fetches XKCD data and returns it in a lightweight format.
  • config.json: Simple runtime configuration used by the Open Integrations.
  • vercel.json: Vercel routing and build configuration.

API behavior

The api/xkcd.js endpoint requests the latest XKCD JSON feed, extracts the minimal fields needed for the display, and returns them for consumption by the render.html

Development

Install the Vercel CLI once, then start the local dev server:

  1. npm i -g vercel
  2. vercel dev

The app will be available at http://localhost:3000. Use /config.json as the integration URL while developing and /render.html to see the preview.

Deployment

Deploy to Vercel and ensure the api directory is recognized as serverless functions. The static rendering uses render.html and does not require a build step.

Integration notes

These kinds of simple plugins can be generated by using the AI of your choice and INSTRUCTIONS.md for reference.

Attribution

XKCD content is © Randall Munroe. See https://xkcd.com/ and https://xkcd.com/license.html for usage details.

About

This is a sample for a very simple implementation using OpenIntegration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published