Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jliuhtonen/lastfm-dump

Export scrobbles from Last.fm to MongoDB
https://github.com/jliuhtonen/lastfm-dump

Last synced: about 1 month ago
JSON representation

Export scrobbles from Last.fm to MongoDB

Awesome Lists containing this project

README

        

# lastfm-dump

Lastfm-dump is a tool that fetches your listening data from Last.fm and inserts them to Mongo DB so you can make all sorts of interesting stuff with your listening data.

The resulting BSON objects will look like this:

```
{
"_id": ObjectId("5522c37ca7956d6b02000010"),
"name": "Carrie & Lowell",
"artist": {
"name": "Sufjan Stevens",
"mbid": "01d3c51b-9b98-418a-8d8e-37f6fab59d8c"
},
"album": {
"name": "Carrie & Lowell",
"mbid": "87b4a614-d53d-4495-b176-5d4f2bb353e6"
},
"url": "http://www.last.fm/music/Sufjan+Stevens/_/Carrie+&+Lowell",
"scrobbledAt": ISODate("2015-04-05T20:56:41Z")
}
```

## Compiling

Install stack and...

```
stack setup
stack build
```

Or use Docker:
`docker build -t lastfm-dump .`

## Usage

To sync your data to Mongo, start your mongod and run `lastfm-dump` with the following env vars set either in `.env` file or environmental variables:

```
MONGODB_PASSWORD=
MONGODB_USER=
MONGODB_DBNAME=
MONGODB_ADDRESS=
MONGODB_PORT=
LASTFM_API_KEY=
PAGE_SIZE=200
LASTFM_USER=myUser
```