Skip to content

halina20011/DailyTopForSpotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daily Top For Spotify

"Daily top for Spotify" is local web server for tracking and viewing your Spotify stats

Configuration

Login to the Spotify Developer Dashboard and create you new "App". You can visit Spotify docs for more info
Add "http://localhost:5000/auth/callback" as new "Redirect URIs"
rename/copy configTemplate.json to Data/config.json
cp configTemplate.json Data/config.json

and fill out SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET from the spotify app settings

Set up MongoDB

start mongodb service sudo systemctl start mongodb.service

connect to the database with mongosh

list all databases show databases

create a database called "dailyTopForSpotify" use dailyTopForSpotify

set up the database:

db.createCollection("history")

db.createCollection("songsSet")
db.songsSet.createIndex({"songId": 1}, {unique: true})

db.createCollection("artistsSet")
db.artistsSet.createIndex({"artistId": 1}, {unique: true})

Deployment

install forever and then run npm install -g forever and then run npm run production
now you can visite http://127.0.0.1:5000/

Import Spotify streaming history

visit "https://www.spotify.com/us/account/privacy/" scroll down and request the "Extended streaming history". After you receive email with "Your Extended streaming history is ready", after that confirm it in email and wait aprox a month. after the data are ready download them and unzip them in some folder

Montoring

to see the logs made by the server use forever logs server.js to get the file path of the log file then use tail -f [fileLogName] for example tail -f ~/.forever/X5Zf.log

Images

preview1

preview2

preview3

preview4

Changes

db.set.renameCollection("songsSet");

db.createCollection("artistsSet")
db.artistsSet.createIndex({"artistId": 1}, {unique: true})

// make backup
db.songsSetCopy.insertMany(db.songsSet.find({}).toArray())

db.songsSet.updateMany({},
  [
    {
      $set: {
        artists: {
          $map: {
            input: "$artists",
            as: "artist",
            in: "$$artist.id"
          }
        }
      }
    }
  ]
);

TODOs

  • switch to vue
  • albums
  • image size
  • all spotify listen history
  • catch month/year listen history (new database)
  • Top items from Spotify

About

local server for tracking and viewing your Spotify stats

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published