Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/kowenhouston/spotify-new-album

Do something when your favourite artist releases a new album
https://github.com/kowenhouston/spotify-new-album

Last synced: about 6 hours ago
JSON representation

Do something when your favourite artist releases a new album

Awesome Lists containing this project

README

        

# spotify-new-album
Historically "following" an artist on spotify hasn't allowed me to be notified immediately of an artist releasing an album. This program is designed to be run along with a wrapper script and cron to tell you when your favourite artist has posted a new album.

# Details
50 min code challenge: Create a program that alerts when your favourite artist adds a new album.


Code is dodgy but it works.

# Install / Run
1. Install prerequisites by running ```pip install python-dateutil spotipy```
1. Go to https://developer.spotify.com/my-applications/ and create an application
1. Set the Redirect URI to http://localhost
1. Export your settings from the my-application page on spotify in your linux terminal:
```
export SPOTIPY_CLIENT_ID=''
export SPOTIPY_CLIENT_SECRET=''
export SPOTIPY_REDIRECT_URI='http://localhost/'
```
5. Edit spotify-new-album.py to enter your username
6. Run python spotify-new-album.py

# Notes
Only tested on Python 3.4


If you import this into another python app you could probably do something cool like text you or whatever. But I had 50 minutes.
![alt text](https://raw.githubusercontent.com/kowenhouston/spotify-new-album/master/spotify-settings.png)

# Sample output
```
(v_spotify) root@not-windows:~/spotify-new-album# python spotify-new-album.py

User authentication requires interaction with your
web browser. Once you enter your credentials and
give authorization, you will be redirected to
a url. Paste that url you were directed to to
complete the authorization.

Opened https://accounts.spotify.com/authorize?client_id=&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2F&scope=user-library-read in your browser

Enter the URL you were redirected to: http://localhost/?code=

Type: Single
Name: For Miles & Miles
Release Date: 2017-04-15
Type: Single
Name: Frameworks
Release Date: 2016-12-19
Type: Single
Name: Beautiful Life
Release Date: 2016-09-05
...
```