"Daily top for Spotify" is local web server for tracking and viewing your Spotify stats
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
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})
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/
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
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
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"
}
}
}
}
]
);
- switch to vue
- albums
- image size
- all spotify listen history
- catch month/year listen history (new database)
- Top items from Spotify