Skip to main content

Gather WebSocket service client

Project description

Inspired by gathertown/mod-spotify-as-status.

Scrobble your last.fm or Spotify activity to the Gather status.

gather-scrobble

gather-scrobble

gather-status

gather-status

Installation

pip install gather-scrobble

As this library has a CLI, you may have permissions issues when installing, so try it with the --user flag:

pip install gather-scrobble --user

Documentation

Configuration

Itโ€™s necessary to configure the following credentials:

Gather Credentials

Access Gather API keis to get your API_KEY.

last.fm Credentials

If you will scrobble from last.fm.

Create a last.fm API account to get your API_KEY and API_SECRET.

Spotify Credentials

If you will scrobble from Spotify.

Access your Spotify account dashboard and create a new app (in case you donโ€™t have one or do not want to use an existing one). And get your CLIENT_ID and CLIENT_SECRET.

Also add a redirect URI in the Edit Settings. Suggested value: http://127.0.0.1:9090.

The spotispy will instantiate a server to receive the access token. More info here.

You can configure your credentials in 4 ways and with respective priorities:

environment variables

export GATHER_API_KEY=<GATHER_API_KEY>
export LASTFM_API_KEY=<LASTFM_API_KEY>
export LASTFM_API_SECRET=<LASTFM_API_SECRET>
export LASTFM_USERNAME=<LASTFM_USERNAME>
export SPOTIFY_CLIENT_ID=<SPOTIFY_CLIENT_ID>
export SPOTIFY_CLIENT_SECRET=<SPOTIFY_CLIENT_SECRET>
export SPOTIFY_CLIENT_REDIRECT_URI=<SPOTIFY_CLIENT_REDIRECT_URI>

.ini file

[settings]
GATHER_API_KEY=<GATHER_API_KEY>
LASTFM_API_KEY=<LASTFM_API_KEY>
LASTFM_API_SECRET=<LASTFM_API_SECRET>
LASTFM_USERNAME=<LASTFM_USERNAME>
SPOTIFY_CLIENT_ID=<SPOTIFY_CLIENT_ID>
SPOTIFY_CLIENT_SECRET=<SPOTIFY_CLIENT_SECRET>
SPOTIFY_CLIENT_REDIRECT_URI=<SPOTIFY_CLIENT_REDIRECT_URI>

.env file

GATHER_API_KEY=<GATHER_API_KEY>
LASTFM_API_KEY=<LASTFM_API_KEY>
LASTFM_API_SECRET=<LASTFM_API_SECRET>
LASTFM_USERNAME=<LASTFM_USERNAME>
SPOTIFY_CLIENT_ID=<SPOTIFY_CLIENT_ID>
SPOTIFY_CLIENT_SECRET=<SPOTIFY_CLIENT_SECRET>
SPOTIFY_CLIENT_REDIRECT_URI=<SPOTIFY_CLIENT_REDIRECT_URI>

Usage

Help

$ gather-scrobble --help
Gather Scrobble v0.0.1
    Usage:
        gather-scrobble start <space_id> [--source SOURCE] [--emojis EMOJIS]
        gather-scrobble info
        gather-scrobble test <space_id>

    Arguments:
        <space_id>          Gather space id.

    Options:
        -h --help           Show this screen.
        -s --source SOURCE  Scrobble source, if not defined the tool will try
                            all available sources configured.
                            Can be: lastfm, spotify, or any.
                            If 'any' it will use the first source configured in
                            the priority: lastfm -> spotify [default: any]
        -e --emojis EMOJIS  It is possible to customize the emojis, by setting
                            the list of emojis that will be chosen randomly,
                            and also you don't like emojis, you can set an
                            empty string here. [default: ๐ŸŽผ๐ŸŽต๐ŸŽถ๐ŸŽง๐Ÿ“ป๐ŸŽท๐ŸŽธ๐ŸŽน]

Info

Before starting, check if you have configured the services:

$ gather-scrobble info
Gather Scrobble
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Service   โ”ƒ Configured   โ”ƒ
โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ
โ”ƒ Gather    โ”ƒ True         โ”ƒ
โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ
โ”ƒ last.fm   โ”ƒ True         โ”ƒ
โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ
โ”ƒ Spotify   โ”ƒ False        โ”ƒ
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›

Test

And test your configuration:

$ gather-scrobble test "aAa0aAaAaaA0Aaaa/Name"
Testing connection with Gather...
Success
Testing connection with last.fm...
Success
Testing connection with Spotify...
Success

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Service   โ”ƒ Working?   โ”ƒ
โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ
โ”ƒ Gather    โ”ƒ True       โ”ƒ
โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ
โ”ƒ last.fm   โ”ƒ True       โ”ƒ
โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ
โ”ƒ Spotify   โ”ƒ True       โ”ƒ
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›

Start

The first time you scrobble for any of the sources, the user will be asked to authorize your application to access data from the respective scrobble sources.

$ gather-scrobble start "aAa0aAaAaaA0Aaaa/Name"
๐ŸŽธ - Evil Papagali - Massacration ๐„›๐„™๐„˜๐„›๐„™

FAQ

  • How to get the space_id value? First enter in the space you want to scrobble, the space_id will be in the URL after the /app/. E.g., in the URL โ€œhttps://app.gather.town/app/aAa0aAaAaaA0Aaaa/Nameโ€ the space_id is aAa0aAaAaaA0Aaaa/Name.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gather-scrobble-0.0.3.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

gather_scrobble-0.0.3-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page