Share access token between spotipy and frontend playback SDK? - spotipy

I'm trying to make a simple jukebox thingy at home with raspberry pi and spotipy librari and spotify's playback SDK. I got spotipy up and running, and now for the playback i got to us the playback SDK. In the SDK guide i have to go through the authorization process again, so I thought, can't I just share the access token I already got using Spotipy with the SDK script I got to make?

Related

Spotify web api sdk

How to play song through spotify web api.
I have build my website using spotify web api node, a library for spotify api.
But I am not able to figure out how to play songs using that library.
I know that i need to use the SDK, but I am not able to figure out how to implement the SDK, I have tried reading the documentation of Spoitfy, but still no progress.
I am new to this, so I don't have much idea. Can someone please explain me how to make it work, or show an example.
You can find an example of how to authenticate, connect and play songs via the Web Playback SDK in this Glitch
The Web Playback SDK is client-side JavaScript library which allows you to create a new player in Spotify Connect and play any audio track from Spotify in the browser.

Difference between AWS IoT Device SDKs and AWS IoT Device Client

I am learning the way to use AWS and searching to understand the Difference between AWS IoT Device SDKs and AWS IoT Device Client.
Finally, I want to use Raspberry Pi for Telemetry, but which set of tools should I use AWS IoT Device SDKs OR AWS IoT Device Client.
Since you are working with Raspberry Pi, I would recommend you to use AWS IOT Device sdk. Specifically AWS IOT Device SDK for Python or Nodejs. Further using AWS IOT Device SDK :
Register Thing in AWS IOT Console
Register Certificates and Download them
Copy over Certificates to Raspberry PI
Use Sample Application provided in AWS IOT SDK GitHub and connect to AWS IOT and start publishing messages.
Here is the helpful repo to get you started : https://github.com/aws/aws-iot-device-sdk-python
AWS IoT Device Client looks like a complete software running on Linux (according to AWS description). AWS IoT Device SDKs on the other hand are libraries that allows you to connect your devices to AWS-IOT through mqtt and websockets protocol.
I personally would go with the classic SDKs approach for the reason that not enough information other than AWS Docs are available for Device Client so far
You can use the IoT Device client to embed within the Firmware of a Device however AWS IOT SDK is more of a library for accessing AWS resources programmatically.

Alexa skill to access a website

I have recently strated learning about Alexa skills. I was wondering if we could access different websites using alexa. For example, "Alexa, show me my facebook notifications"
So far I have seen examples of how we can create WebAPIs using Amazon API Gateway. But can we access a different website or a blog with GET or POST method that is not using Amazon API Gateway.
Also, what authorizations will be needed to do this?
For example, "Alexa, show me my facebook notifications"
Yes, it is possible to have that kind of functionality.
Currently, I'm developing with nodejs and use the request-promise module for making HTTP request to my server.
Also, there is a nice tutorial using the request npm module.

Spotify web api to play playlists

I'm building a voice activated AI system for my home. A la Echo, I want to be able to start streaming music on my android host when I say "play some rock". I can handle the ai part, but I need a web API endpoint to start streaming music.
Here's Web API Endpoint Reference. This Web API endpoints gives external applications access to Spotify catalog and user data. And some Web API Code Examples & Libraries and here's Working With Playlists.
Also have a look at this. This repo is a Go wrapper for working with Spotify's Web API which aims to support every task listed in the Web API Endpoint Reference.
Hope this helps!
The Mopidy music server can stream music from spotify and offers lots of API options for clients.

Google replacement for CloudMqtt

We have an IoT project here
Facts:
We have our app running on Google App Engine, PHP runtime.
The clients are raspberry pi or similar boards.
We are using cloudmqtt (www.cloudmqtt.com) to generate a push event on our C client app, which then runs the sync process with the server
Is there a google cloud replacement for what we are doing?
We tried Google Push/Sub, but our C app needed to be polling the service.
We would love to use Google Cloud Messaging but we could not find any way to use it for push notifications for the client.
Basically, we need to send push messages to a raspberry pi, what would you recommend for that? (remember our server is on GAE)
GCM handle polling mechanisms on its own and should let you push notifications as well as messages to the client. Try debugging your application using documentation.
During I/O 2016, they also launched Firebase Cloud Messaging (FCM) which is basically a newer version of GCM, and is the recommended product to use.
But if you wanted to use your deployment rather than a service, you can use Google Compute Engine instances to deploy EMQTTD which is a highly scalable MQTT broker written in Erlang.

Resources