{"id":16878788,"url":"https://github.com/peterj/ppp-gumroad-discounts","last_synced_at":"2025-07-30T00:37:40.568Z","repository":{"id":145601184,"uuid":"300760110","full_name":"peterj/ppp-gumroad-discounts","owner":"peterj","description":"Create PPP discount codes in Gumroad","archived":false,"fork":false,"pushed_at":"2020-10-02T23:52:54.000Z","size":5,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T12:09:01.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-02T23:48:57.000Z","updated_at":"2024-07-28T14:00:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2f17fbe-c0f4-48e1-926b-279a81f6cecf","html_url":"https://github.com/peterj/ppp-gumroad-discounts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterj/ppp-gumroad-discounts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterj%2Fppp-gumroad-discounts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterj%2Fppp-gumroad-discounts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterj%2Fppp-gumroad-discounts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterj%2Fppp-gumroad-discounts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterj","download_url":"https://codeload.github.com/peterj/ppp-gumroad-discounts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterj%2Fppp-gumroad-discounts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267785962,"owners_count":24144124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T15:51:24.472Z","updated_at":"2025-07-30T00:37:40.544Z","avatar_url":"https://github.com/peterj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Purchasing Power Parity (PPP) Discount Code Generator for Gumroad\n\nThis script calculates the PPP discounts and creates the discount codes in Gumroad.\n\n## What do I need to run this?\n\nThere are a couple of API keys you will need - all of the APIs are either free or have a free tier:\n\n1. [Open Exchange Rates](https://openexchangerates.org/)\n2. [Quandl](https://docs.quandl.com/)\n3. [Gumroad API token](https://gumroad.com/api#api-authentication) (if you want to automatically create discount codes)\n4. Gumroad Product ID s(see [Gumroad Products API](https://gumroad.com/api#products) on how to get this)\n\nBefore running anything, make sure you set these values in `index.js`.\n\n## What values do I need to set?\n\nOnce you obtained all keys, open the `index.js` file and set them based on the table below.\n\n| Setting | Variable name|\n| --- | --- |\n| Open Exchange Rates | `OpenExchangeKey` |\n| Quandl | `QuandlKey` |\n| Gumroad API token | `GumroadToken` |\n| Gumroad product ID | `gumroadProductId` |\n\n\nIn addition to the API keys, you also have to set/change the following settings:\n\n`countryCodes`: list of two-letter country codes you want to generate the discounts for \n\n`maxOfferCodes`: number of times each discount can be used (set to `undefined` for unlimited)\n\n## How to run it?\n\nAssuming you've set all of the above, you can run the script using `node index.js`.\n\nIf you haven't changed the `CREATE_DISCOUNT_CODES` variable, the script will give you a list of generated codes, that will look like this:\n\n```\n$ node index.js\nDiscount codes will not be created. Change CREATE_DISCOUNT_CODES to 'true' to create them.\nBR - 64 - BR-r6i8c\nIN - 75 - IN-m5x2a\nCZ - 42 - CZ-2wctfd\nSI - 29 - SI-soqci\n```\n\nTo create the Gumroad discount codes, make sure you set the Gumroad token (`GumroadToken`) and the Gumroad product ID (`gumroadProductId`). Then, set the `CREATE_DISCOUNT_CODES` variable to `true` and re-run the script.\n\n\u003eThe script will create PERCENTAGE discounts. Refer to the Gumroad API if you want to use the fixed amount instead. \n\nHere's how the output will look like this time (if there's no errors):\n\n```\n$ node index.js\n{\n  name: 'BR-glx1k6',\n  amount_off: '64',\n  offer_type: 'percent',\n  max_purchase_count: 100,\n  universal: false\n}\n{\n  name: 'IN-xtb007',\n  amount_off: '75',\n  offer_type: 'percent',\n  max_purchase_count: 100,\n  universal: false\n}\n{\n  name: 'CZ-ggahj4',\n  amount_off: '42',\n  offer_type: 'percent',\n  max_purchase_count: 100,\n  universal: false\n}\n{\n  name: 'SI-dr34dg',\n  amount_off: '29',\n  offer_type: 'percent',\n  max_purchase_count: 100,\n  universal: false\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterj%2Fppp-gumroad-discounts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterj%2Fppp-gumroad-discounts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterj%2Fppp-gumroad-discounts/lists"}