Skip to content

A Cloudflare Workers script that augments Etsy product links on a webpage by adding price and quantity information to it.

Notifications You must be signed in to change notification settings

victoriachan/cfworker-etsy-price-fetcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Etsy Price Fetcher Cloudflare Workers script

A simple Cloudflare Workers script that augments Etsy product links on a webpage by adding price and quantity information to the link's title attribute.

The script finds all the <a> tags on the page with class='etsy' that links to an Etsy product, and adds title attribute to them with the product's Etsy price and quantity (fetched from Etsy API).

Example anchor link: <a class="etsy external" href="https://www.etsy.com/uk/listing/826425463/puteh-original-drypoint-etching-print?ref=shop_home_active_1"></a>

If the product is not found on Etsy API, then it is assumed that the product link is outdated, and will be removed from the page.

To use:

  • Define ETSY_PRICES Cloudflare Workers KV, and add bindings to the CF Worker.
  • Register with Etsy API and set the API key as ETSYAPIKEY env var for the CF Worker.
  • Enable the Worker script in your Cloudflare zone.

To develop:

About

A Cloudflare Workers script that augments Etsy product links on a webpage by adding price and quantity information to it.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published