Aug 7, 2023

How to use Newsboat along with Spotify

How to use Newsboat along with Spotify

I use Newsboat. Let me know what you think, or have problems with this.

  1. Install tools:

    To install Newsboat on a Linux-based system, use the following command:

    sudo apt-get install newsboat
    

    To install jq, use the following command:

    sudo apt-get install jq
    

    Note: These commands are for Ubuntu. For other systems, please refer to the respective documentation.

  2. Fetch and filter RSS feed:

    Use the curl command to fetch the RSS feed:

    curl 'http://twitrss.me/twitter_user_to_rss/?user=username'
    

    Pipe the output to jq to filter the tweets:

    jq '.items[] | select(.title | contains("#NowPlaying"))'
    

    Extract links from the filtered tweets:

    jq -r '.link'
    

    Note: These commands should be combined into one pipeline, as demonstrated in the previous response.

  3. Interact with Spotify's Web API:

    Before you can interact with Spotify's API, you need to authenticate using OAuth 2.0. You can do this with the Authorization Code Flow, which involves several steps:

    • Register your app
    • Request authorization from the user
    • Exchange the authorization code for an access token
    • Use the access token to access the Web API
  4. Add songs to a playlist:

    Once you have the access token, you can add songs to a playlist with the following command:

    curl -X "POST" "https://api.spotify.com/v1/playlists/{playlist_id}/tracks" -H "Accept: application/json" -H "Authorization: Bearer {access_token}" --data "{track_uris}"
    

    Replace {playlist_id}, {access_token}, and {track_uris} with your specific details.