import { Hono } from "hono";
import PDFDocument from "pdfkit";
const app = new Hono();To use this script, simply replace the USERNAME, REPOSITORY, GITHUB_STARS_REPO and GITHUB_DOWNLOADS_REPO placeholders with the appropriate values for the GitHub repository you want to fetch the star and release download count for. Then, copy the complete script into a new Scriptable App script and run it. The star and release download count for the specified repository will be displayed in a Scriptable widget.
// Constants for widget configuration
const WIDGET_TITLE = "GitHub";
const USERNAME = "hoppscotch"
const REPOSITORY = "hoppscotch"
const GITHUB_STARS_REPO = "hoppscotch/hoppscotch";
const GITHUB_DOWNLOADS_REPO = "hoppscotch/releases";
const CACHED_DATA_HOURS = 0.5;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable no-unused-vars */ | |
| /* eslint-disable no-else-return */ | |
| // JSX constructor, similar to createElement() | |
| export const h = (type, props, ...children) => { | |
| return { | |
| type, | |
| // Props will be an object for components and DOM nodes, but a string for | |
| // text nodes | |
| props, |