Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DotMH

Now Playing API

Last.fm TypeScript Deno JS Hono

Visual Studio Code Conventional Commits

License Contributor Covenant

A small API using Deno that will get the currently playing information for a user from Last fm and return it. It is designed to be easily deployed to Deno Deploy.

Getting Started

The easiest and only supported way to deploy this is to use Deno Deploy.

Magic

Deploy on Deno

  • Get your last.fm API Key from https://www.last.fm/api/accounts
  • click the "Deploy on Deno" button above
  • Click the "Add Environment Variables" button
  • Add the following
    • add LASTFM_API_KEY with your API Key from Last.fm
    • add CONFIG_USER with the last.fm username
  • Click "Create App"
  • execute a get request to the URL to make sure it is working
  • Party

Manual

  • fork this repo
  • create an account on and/or login to https://console.deno.com/
  • Get your last.fm API Key from https://www.last.fm/api/accounts
  • on the Deno Deploy dashboard click "New App"
  • Connect Deno deploy to your GitHub account
  • Select the fork of this repo you made
  • Click the "Add Environment Variables" button
  • Add the following
    • add LASTFM_API_KEY with your API Key from Last.fm
    • add CONFIG_USER with the last.fm username
  • Click "Create App"
  • execute a get request to the URL to make sure it is working
  • Party

Developing

  • Install Deno from https://deno.com/
  • Get a Last.fm API Key from https://www.last.fm/api/accounts
  • Clone this repo
  • Created a .env file in the root of the project
    • add LASTFM_API_KEY with your API Key from Last.fm
    • add CONFIG_USER with the last.fm username
  • run deno run dev

API

The only endpoint is

GET /

Arguments: none

Response:

Success:

application/json

{
    state: "success",
    data: {
      images: { src: string, size: "small" | "medium" | "large" | "extralarge" }[];
      artist: string;
      album: string;
      track: string;
      user: string;
      nowPlaying: boolean;
  }
}

Error:

application/json

{
    state: "error",
    data: string
}

About

An API to get what I am currently Listening to

Topics

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages