welles / spotifysyncgoogle Goto Github PK
View Code? Open in Web Editor NEWContinuously adds your saved songs on Spotify to a playlist which can be shared with others, using time-based triggers on Google Apps Script.
License: MIT License
Continuously adds your saved songs on Spotify to a playlist which can be shared with others, using time-based triggers on Google Apps Script.
License: MIT License
Hey there,
I used your code as the underlying foundation for a project involving Spotify and google scripts.
I wanted to mention that I think I found a better way of updating playlists, especially considering the six minute time limit Google Scripts has for any one function:
https://github.com/gardinermichael/UpcomingShowsSpotifySyncGoogle/blob/main/app/Main.gs#L170
https://github.com/gardinermichael/UpcomingShowsSpotifySyncGoogle/blob/main/app/Main.gs#L248
The basic gist is that instead of adding or removing songs one by one, you take a giant array of track URIs (in the order that you want them in) and cut that up into smaller arrays of about 30 tracks each. This is because there is a URL size limit for URLFetch. Once you do that, you run a for loop going through each array hitting a url containing just those URIs. The trick is that for the first array in the array of arrays, you use this PUT call:
https://developer.spotify.com/documentation/web-api/reference/#/operations/reorder-or-replace-playlists-tracks
https://developer.spotify.com/console/put-playlist-tracks/
What this does is wipe the entire playlist to those first 30 tracks. However, when you're processing the subsequent arrays, you use the regular POST call to the same url that appends tracks to the playlist instead.
https://developer.spotify.com/documentation/web-api/reference/#/operations/add-tracks-to-playlist
https://developer.spotify.com/console/post-playlist-tracks/
It significantly decreases the processing time for editing the playlists, while still working with your CURRENT/LOG dashboard setup in Google Sheets.
Please let me know what you think or if anything doesn't make sense.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.