Creating Spotify playlist with standalone web app - spotify

I just want to be able to create a playlist by sending / receiving http requests ( a standalone web app, not with Spotify Apps and the desktop client). I've dug around the docs and can't find a clear solution. Can someone point me in the right direction? Thanks in advance.

You can pass a list of songs—not a playlist—to the desktop player by adding the track ids to a link as below
Play
UPDATE
As of today there is an api for creating playlists: https://developer.spotify.com/web-api/create-playlist/

I just want to be able to create a playlist by sending / receiving
http requests
This isn't possible at the moment — Spotify doesn't have a web API for manipulating playlists. You may be able to hack a solution together using libSpotify, although using libSpotify in a server service this way is against the ToS.

You might want to look at https://github.com/liesen/spotify-api-server
It is limited to just one spotify account (the one you configure it with) but does allow playlist creation/manipulation via RESTish calls.

Related

How to setup action on Google API on local server?

I am new for action for Google, and I want a help. I want to create a chatbot and wanna use actions on Google API for this, I came across certain blogs but I can not understand how to setup this thing and local and make use of actions on Google API's in a productive way. I have read the documentation but nothing seems to be work in a desired manner. Please help me with initial steps where I could begin with.
I think you should read the documents properly. Here's the correct address for developing actions :- https://developers.google.com/actions/apiai/
This is the perfect document, if you will use API.ai. If you want to learn faster then you have to watch videos. Here is the link for the basic video.
This is the basic video you need to watch :- https://youtu.be/5Al0bfCF-xA
I think this video will help you alot. If still you need some more help for building apps, do reply we will help !
You can test it on your local server by opening up a port on your wifi router and and forward that port to you server ip and port. However, you still https call from api.ai to your local server.

A way around a Chron script

Is there a way to do the following in a SPA:
Add User
Update list of users, for all other logged in users, with the added user if they are in the User List Module of the application. Do this without a chron job constantly checking if there is a new user.
Almost like forcing a response without a Request. Is this a Unicorn?
I am trying to see if there is an efficient way of doing this.
Technologies are NodeJS, Express, and React on the client.
You could try setting up a websocket connection between your logged in users and your server. That way, you would be able to push a change (like a new user being added) to all your clients. However, all the clients would still need to be constantly online. Try looking into socket.io as a gentle introduction to websockets.
You could also try looking into WebRTC and other P2P web technologies, though I'm not sure if that would help you in any way.

Do i need to setup a server to use spotifys authorization code flow?

I am using Electron to create an app for my raspberry pi to run and i want to be able to use my spotify playlists but i am having a little trouble using their api. I need to use their authorization code flow which grants you an access token after you login in. My question is, do i need to have my app running on a server (in localhost) in order to be able to make use of the spotify api ? I started playing around with Express but i am still not quite sure what i am doing or need to do.
Has anyone done this before or have any advice?
Are there any nodejs modules that help with this kind of authentication?

Google apps script in HTML

Is it possible to use google apps script in my HTML? I want to be able to write to a spreadsheet from a form in purely Javascript from an external framework such as Node.js.
https://developers.google.com/apps-script/
Google Apps Script's syntax is Javascript, however it is a unique server-side framework that does not behave as a library to applications outside of the Apps Script servers. (No, you won't be able to use Google Apps Script in your node.js app.)
However, that doesn't mean that your node.js app (or any other app on the web) can't interact with your spreadsheet. For instance, your app could authenticate as you using the OAuth API, then access the spreadsheet through the Google Drive API. For an example of this, see Accessing Google Spreadsheets from Node.js
Alternatively, you could roll your own spreadsheet API in Google Apps Script, to support read / write of your sheet via HTTP requests from your node.js app. There are plenty of examples of that, for example Insert new rows into Google Spreadsheet via cURL/PHP - HOW?.
Sure you can. You can use HtmlService to create your web form, then send the submission data to your Spreadsheet with server functions.
Nowadays you could use the Google Apps Script API to call your Google Apps Script code from other platforms like Node.js, actually the official docs include a quickstart for Node.js.
You can you use HtmlService, but maybe can be helpfull to read the Google Hosted Libraries https://developers.google.com/speed/libraries/
To use a Javascrtip library inside GAS, I recommend JQuery.
But Maybe, you can use Node.js inside your external website and make a AJAX Request (get or post) to a GAS and return from GAS this:
ContentService.createTextOutput(e.parameter.callback + "("+Utilities.jsonStringify(JSONDATA)+")").setMimeType(ContentService.MimeType.JSON);
After that, process it inside your AJAX request...
Mogsad is right that you might be better of with Google Drive API to interact with your Spreadsheet!
...But depending on your exact need you might have some possible interaction between external service and google apps scrip using Content service Google Dev link.
Content Service can send back several information upon GET request (ATOM, CSV, ICAL, JAVASCRIPT, JSON, RSS, TEXT, VCARD, XML). By playing around with url parameters you can get information out and in a spreadsheet, send an email, trigger some action etc!.
But that is far from a real external library and direct interaction with server side functions!

Distributing Twitter Widget Among Application Users

Hey guys is there anyway to circumvent the Twitter rate limit by using a Twitter widget and embedding it in the end users browser? In other words would using Twitter Search widget apart of the user's browser's session (while they are using my app) so that their calls to Twitter are made through their IP address (and not the IP address of my app) - I would do this to avoid getting the IP of my app blacklisted. Is that fine or would that violate Twitter's terms of use?
I would use the Twitter search widget. Would using Twitter stream be a better idea?
Depending on your implementation, you may want to consider the Streaming API for this purpose. It's probably considered more "kosher". You can query for a particular set of phrases and open whats called a firehose, and Twitter will push updates to your application and it's not really bound by rate limits although there is a rate limit system in place here. For my particular use case, this didn't work and I had to do what you described in your question. But if you want to use the Twitter streaming API and are using PHP in conjunction, I would highly recommend looking at the 140 Twitter Server framework at the start. It will make it a lot easier to implement the streaming API at the get go.
This is fine, and this is the solution I'm using. Use jQuery or something similar for the Ajax calls and send the response to the server for processing. The carry will be on each of the IP's that use your application. So, if that user is spamming Twitter with requests - they would get blacklisted, not your application.

Resources