A zero-dependencies script to generate sponsors SVG from Patreon

Overview

sponsors

A zero-dependencies script to generate sponsors SVG from Patreon.

Usage

Go to https://www.patreon.com/portal/registration/register-clients to create an API Key. Once done, take note of your Creator's Access Token. It would be used to fetch data from the Patreon API.

Create an .env file, replace <creators_access_token> with the token above:

PATREON_ACCESS_TOKEN=<creators_access_token>

Run npm run gen to generate the SVG.

Serving the SVG

The gist.sh script uses GitHub gist as a static file host. Go to https://gist.github.com and create a public gist. Give any description and create a sponsors.svg file with <svg></svg> as the content (temporary only). Click on the embed button, change to Clone via HTTPS, and take note of the git URL.

Update the .env file with the git URL:

SPONSORS_GIST=<git_url>

Make sure there's an existing sponsors.svg file locally before continuing to the next step.

To update the sponsors.svg file of the gist, run npm run gist. It will create a temporary gist folder, copy over the sponsors.svg file, and force push to the remote gist to ensure only one commit exists.

Next, go to http://raw.githack.com to retrieve a link to the SVG. You should paste in something like https://gist.github.com/user/gist_id/raw/sponsors.svg to retrieve a prod and dev URL.

You can now use these URLs anywhere. For my case, I've setup https://bjornlu.com/sponsors.svg to redirect to the URL.

Since githack caches prod URLs strongly, you might want to purge the cache when updating sponsors. This is also automated by providing the prod URL in the .env file:

SPONSORS_URL=<prod_url>

Note: Purge the cache sparingly as githack heavily throttles subsequent requests.

Note: The guide has the following assumptions:

  1. The git remote uses HTTPS.
  2. You have credentials to update gists. Create a personal access token otherwise.
  3. The default git branch is master.

Todo

  • Pre-round the images to produce smaller SVG size
  • Use CSS style to group some styles
  • More configuration options

Attribution

Sponsors

Sponsors

License

MIT

You might also like...

open-sourced boilerplate NFT projects (Shopify, Opensea, Patreon, etc)

👋 Quickly start any NFT projects A collection of boilerplates for full-stack dapps that showcase some of the use case for NFTs. Think of web3 native,

Jan 12, 2022

Simple, responsive, modern SVG Charts with zero dependencies

Simple, responsive, modern SVG Charts with zero dependencies

Frappe Charts GitHub-inspired modern, intuitive and responsive charts with zero dependencies Explore Demos » Edit at CodePen » Contents Installation U

Jan 4, 2023

Minimalistic, animated SVG gauge. Zero dependencies

SVG Gauge Minmalistic, configurable, animated SVG gauge. Zero dependencies Buy me a coffee ☕ If you like my work please consider making a small donati

Dec 17, 2022

💖 Toolkit for generating sponsors images 😄

SponsorKit Toolkit for generating sponsors images. Usage Create .env file with: ; Token requires the `read:user` and `read:org` scopes. SPONSORKIT_GIT

Jan 2, 2023

🍎Transform an SVG icon into multiple themes, and generate React icons,Vue icons,svg icons

🍎Transform an SVG icon into multiple themes, and generate React icons,Vue icons,svg icons

IconPark English | 简体中文 Introduction IconPark gives access to more than 2000 high-quality icons, and introduces an interface for customizing your icon

Jan 5, 2023

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Fabric.js Fabric.js is a framework that makes it easy to work with HTML5 canvas element. It is an interactive object model on top of canvas element. I

Jan 3, 2023

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Fabric.js Fabric.js is a framework that makes it easy to work with HTML5 canvas element. It is an interactive object model on top of canvas element. I

Jan 3, 2023

Converts geojson to svg string given svg viewport size and maps extent.

geojson2svg Converts geojson to svg string given svg viewport size and maps extent. Check world map, SVG scaled map and color coded map examples to de

Dec 17, 2022

The slides in this slideshow wobble as they move. The effect is based on Sergey Valiukh's Dribbble shot and was made using Snap.svg and morphing SVG paths.

Wobbly Slideshow Effect The slides in this slideshow wobble as they move. The effect is based on Sergey Valiukh's Dribbble shot and was made using Sna

Jul 27, 2022

700+ Pure CSS, SVG & Figma UI Icons Available in SVG Sprite, styled-components, NPM & API

700+ Pure CSS, SVG & Figma UI Icons Available in SVG Sprite, styled-components, NPM & API

700+ Pure CSS, SVG & Figma UI Icons Available in SVG Sprite, styled-components, NPM & API

Jan 2, 2023

A Javascript library to export svg charts from the DOM and download them as an SVG file, PDF, or raster image (JPEG, PNG) format. Can be done all in client-side.

svg-exportJS An easy-to-use client-side Javascript library to export SVG graphics from web pages and download them as an SVG file, PDF, or raster imag

Oct 5, 2022

Zero Two Bot,A fully Modular Whatsapp Bot to do everything possible in WhatsApp by Team Zero Two

Zero Two Bot,A fully Modular Whatsapp Bot to do everything possible in WhatsApp by Team Zero Two

🍭 𝗭𝗲𝗿𝗼 𝗧𝘄𝗼 𝗠𝗗 🍭 A Moduler WhatsApp Bot designed for both PM and Groups - To take your boring WhatsApp usage into a whole different level. T

Dec 25, 2022

Multiplies a number by zero. Useful for when you need to multiply a number by zero

multiply-by-zero Multiplies a number by zero. Useful for when you need to multiply a number by zero Please consider checking out the links of this pro

Jul 3, 2022

Ultra lightweight, usable, beautiful autocomplete with zero dependencies.

Awesomplete https://leaverou.github.io/awesomplete/ Awesomplete is an ultra lightweight, customizable, simple autocomplete widget with zero dependenci

Jan 2, 2023

Ultra lightweight, usable, beautiful autocomplete with zero dependencies.

Awesomplete https://leaverou.github.io/awesomplete/ Awesomplete is an ultra lightweight, customizable, simple autocomplete widget with zero dependenci

Jan 2, 2023

JavaScript syntax highlighter with language auto-detection and zero dependencies.

Highlight.js Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It can work with pretty muc

Jan 5, 2023

1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.

JavaScript Templates Contents Demo Description Usage Client-side Server-side Requirements API tmpl() function Templates cache Output encoding Local he

Jan 3, 2023

Zero dependencies, lightweight, and asynchronous https requests package.

Zero dependencies, lightweight, and asynchronous https requests package.

This project is a Work in Progress and currently in development. The API is subject to change without warning. A small fetching package for super simp

Dec 8, 2022

Lightweight (zero dependencies) library for enabling cross document web messaging on top of the MessageChannel API.

Lightweight (zero dependencies) library for enabling cross document web messaging on top of the MessageChannel API.

Jul 15, 2022
Owner
Bjorn Lu
Building tools for fun. @sveltejs and @vitejs team member.
Bjorn Lu
⚡A zero-config bundler for JavaScript applications.

Poi is a bundler built on the top of webpack, trying to make developing and bundling apps with webpack as easy as possible. The Poi project is support

Eren Bets 5.3k Jan 4, 2023
Minimal, zero-configuration and fast solution for static site generation in any front-end framework.

Staticit - Introduction Whether you want to increase performance of your web application or improve SEO. Generally you have 2 options, use SSR (Server

Engineerhub 4 Jun 11, 2022
A modern, zero-dependency uptime monitoring tool & status page based on GitHub Actions & Nuxt Content v2.

StatusBase Uptime monitoring tool & beautiful status pages Powered by Nuxt Content v2! Free • Open Source • Notification View Demo · Report Bug · Requ

zernonia 208 Dec 27, 2022
Batteries-included, zero-config Ionic integration for Nuxt

Nuxt Ionic Ionic integration for Nuxt ✨ Changelog ?? Read the documentation ▶️ Online playground Features ⚠️ nuxt-ionic is currently a work in progres

Daniel Roe 211 Dec 28, 2022
A modern, zero-dependency uptime monitoring tool & status page based on GitHub Actions & Nuxt Content v2.

StatusBase Uptime monitoring tool & beautiful status pages Powered by Nuxt Content v2! Free • Open Source • Notification View Demo · Report Bug · Requ

StatusBase 194 Jul 5, 2022
Create Nuxt3 apps with zero effort.

Create Nuxt3 Create Nuxt3 apps with zero effort. Features Select UI frameworks and install it from list Install extra modules like '@nuxt/content' Ins

Mehmet Ali Külahçı 8 Jul 9, 2022
:fire::fire::fire: 强大的动态表单生成器|form-create is a form generation component that can generate dynamic rendering, data collection, verification and submission functions through JSON.

form-create form-create is a form generation component that can generate dynamic rendering, data collection, verification and submission functions thr

xaboy 4.6k Jan 3, 2023
🧞‍♂️ MESH·Y is a design tool to generate beautiful & colorful mesh gradients

Meshy is a design tool to generate beautiful & colorful mesh gradients. Generate multiple random variations of Mesh gradients along with cool color customizations. Export PNG image with custom resolution.

Anup Aglawe 255 Dec 22, 2022
Auto generate the corresponding `.env` file.

unplugin-vue-dotenv Auto generate the corresponding .env file. Install npm i unplugin-vue-dotenv Vite // vite.config.ts import Dotenv from 'unplugin-v

Chris 6 Dec 24, 2022
Repository to generate meetup trailers for social network like Twitter, Reddit, Slack to announce speakers and talks and sponsors 📣

LyonJS meetup social trailer videos generator This github project use Remotion to generate video for LyonJS social network. We could generate video di

LyonJS 5 Dec 13, 2022