{"id":18816050,"url":"https://github.com/0-vortex/cf-workers-lastfm-shields","last_synced_at":"2025-07-05T07:38:04.020Z","repository":{"id":151933276,"uuid":"315209578","full_name":"0-vortex/cf-workers-lastfm-shields","owner":"0-vortex","description":"Generate last.fm most recently played shields endpoint configuration with Cloudflare Workers in 200+ edge locations.","archived":false,"fork":false,"pushed_at":"2020-12-03T02:23:56.000Z","size":107,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T12:39:12.158Z","etag":null,"topics":["badges","badges-markdown","cloudflare","cloudflare-workers","github","lastfm","lastfm-api","markdown","markdown-badges","readme","shieldsio","shieldsio-endpoint"],"latest_commit_sha":null,"homepage":"https://workers.vortex.name/lastfm/endpoint.json","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0-vortex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"0vortex","liberapay":"ted.vortex","issuehunt":"0-vortex","custom":["https://PayPal.Me/TeodorDutulescu"]}},"created_at":"2020-11-23T05:28:19.000Z","updated_at":"2023-11-20T16:57:46.000Z","dependencies_parsed_at":"2023-05-18T03:00:36.072Z","dependency_job_id":null,"html_url":"https://github.com/0-vortex/cf-workers-lastfm-shields","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0-vortex%2Fcf-workers-lastfm-shields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0-vortex%2Fcf-workers-lastfm-shields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0-vortex%2Fcf-workers-lastfm-shields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0-vortex%2Fcf-workers-lastfm-shields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0-vortex","download_url":"https://codeload.github.com/0-vortex/cf-workers-lastfm-shields/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248789715,"owners_count":21161873,"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","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":["badges","badges-markdown","cloudflare","cloudflare-workers","github","lastfm","lastfm-api","markdown","markdown-badges","readme","shieldsio","shieldsio-endpoint"],"created_at":"2024-11-07T23:52:03.755Z","updated_at":"2025-04-13T22:21:08.568Z","avatar_url":"https://github.com/0-vortex.png","language":"JavaScript","funding_links":["https://ko-fi.com/0vortex","https://liberapay.com/ted.vortex","https://issuehunt.io/r/0-vortex","https://PayPal.Me/TeodorDutulescu"],"categories":[],"sub_categories":[],"readme":"# workers-lastfm-shields\n\n[![Deploy to CF Workers](https://github.com/0-vortex/workers-lastfm-shields/workflows/Deploy%20to%20CF%20Workers/badge.svg)](https://github.com/0-vortex/workers-lastfm-shields/actions?query=workflow%3A%22Deploy+to+CF+Workers%22)\n [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2F0-vortex%2Fworkers-lastfm-shields.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2F0-vortex%2Fworkers-lastfm-shields?ref=badge_shield)\n\n[![Commitizen Friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n [![License](https://img.shields.io/github/license/0-vortex/workers-lastfm-shields)](./LICENSE)\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/61fe62f7c3b6394bd344/maintainability)](https://codeclimate.com/github/0-vortex/workers-lastfm-shields/maintainability)\n [![Depfu](https://badges.depfu.com/badges/9f9ccdbef5e16341505ebb914abfcc1b/overview.svg)](https://depfu.com/github/0-vortex/workers-lastfm-shields?project_id=17814)\n [![Known Vulnerabilities](https://snyk.io/test/github/0-vortex/workers-lastfm-shields/badge.svg?targetFile=package.json)](https://snyk.io/test/github/0-vortex/workers-lastfm-shields?targetFile=package.json)\n\n## Overview\n\nA Cloudflare Workers script to display [last.fm](https://www.last.fm/user/zero-vortex) most recently played track in a [shields.io](https://shields.io/endpoint) compatible [endpoint.json](https://workers.vortex.name/lastfm/endpoint.json) schema. \n\n## Folder structure\n\n```\n├──── workers-lastfm-shields\n│  ├── .github/\n│  ├── src/\n│  ├── static/\n│  ├── .editorconfig\n│  ├── .eslintrc.js\n│  ├── .gitattributes\n│  ├── .gitignore\n│  ├── .lintstagedrc.js\n│  ├── .npmrc\n│  ├── CODE_OF_CONDUCT.md\n│  ├── LICENSE\n│  ├── npm-shrinkwrap.json\n│  ├── package.json\n│  ├── README.md\n│  └── wrangler.toml\n```\n\n##  Deploy as Cloudflare Worker\n\nI use this service for my profile at [github.com](https://github.com/0-vortex). Currently, the service is hosted on a free tier of [Cloudflare Workers](https://workers.cloudflare.com/) and limited at 100K requests per day.\nMake sure to make the appropriate changes in [wrangler.toml](./wrangler.toml) first.\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/abskmj/badges-lastfm)\n\n## Requirements\n\nIn order to run the project locally you need ``node\u003e=14`` and ``npm\u003e=6``. \n\n### Install ``@cloudflare/wrangler``\n\nMake sure you have the latest version of ``wrangler`` as described in [the wrangler docs](https://developers.cloudflare.com/workers/cli-wrangler/install-update).\n\n#### Updating Wrangler with NPM:\n\n```shell\nnpm uninstall -g @cloudflare/wrangler \u0026\u0026 \n  npm install -g @cloudflare/wrangler \n```\n\n#### Install with cargo\n\n```shell\ncargo install wrangler --force\n```\n\n### Get a valid ``CF_API_TOKEN``\n\nMake sure you have a valid deployment token by doing: \n\n```shell\nwrangler login \n```\n\nor:\n\n```shell\nwrangler config \n```\n\n### Generate a new repository\n\nCreate a new GitHub repository with the green button or clone:\n\n```shell\n# with git\ngit clone https://github.com/0-vortex/workers-lastfm-shields.git\n```\n\nor with [github-cli](https://cli.github.com):\n\n```shell\n# with github-cli\ngh repo clone  0-vortex/workers-lastfm-shields\n```\n\n### Get a LastFM ``API_KEY``\n\nCreate a secret ``API_KEY`` for the Cloudflare Worker to use the LastFM APIs.\n\n- Steps for getting an API key is available at [last.fm](https://www.last.fm/api/account/create).\n- Steps for creating a secret is available at [developers.cloudflare.com](https://developers.cloudflare.com/workers/platform/environments#environment-variables).\n\n## Usage\n\n### Local development\n\nTo develop locally just run:\n\n```shell\nnpm start\n```\n\nTo deploy to ``dev`` just run:\n\n```shell\nnpm run deploy\n```\n\n### Monitoring\n\nTo monitor any of the deployed environments run:\n\n```shell\nwrangler tail\n```\n\n### Customised markdown badges\n\nWithout modifying [the worker](./src/index.js) it should look like this:\n\n```markdown\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json)\n```\n\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json)\n\nAdditional query parameters can be appliedas follows.\n\n#### Style\n\n```markdown\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json\u0026style=flat)\n```\n\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json\u0026style=flat)\n\n#### Color\n\n```markdown\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json\u0026color=green)\n```\n\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json\u0026color=green)\n\n#### Label\n\n```markdown\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json\u0026label=Recently%20Played)\n```\n\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json\u0026label=Recently%20Played)\n\n#### Logo color\n\n```markdown\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json\u0026logoColor=green)\n```\n\n![](http://img.shields.io/endpoint?url=https://workers.vortex.name/lastfm/endpoint.json\u0026logoColor=green)\n\n## License\n\nThis library is released under BSD-3 license clause.\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2F0-vortex%2Fworkers-lastfm-shields.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2F0-vortex%2Fworkers-lastfm-shields?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0-vortex%2Fcf-workers-lastfm-shields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0-vortex%2Fcf-workers-lastfm-shields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0-vortex%2Fcf-workers-lastfm-shields/lists"}