-
-
Save brandongalbraith/4cc43619262466cb2296e79bf2bea544 to your computer and use it in GitHub Desktop.
Revisions
-
dnnsmnstrr revised this gist
Feb 19, 2023 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ function transform(clip) { const pathRegex = /^[a-z]+:\/\/[^:\/]+(:[0-9]+)?\/(.*?)(\/[0-9]+)?(\?.*)?$/ const uriPath = clip.text.replace(pathRegex, '$2'); const spotifyUri = "spotify:" + uriPath.replaceAll('/', ':') return spotifyUri; } -
dnnsmnstrr created this gist
Feb 19, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ function transform(clip) { const pathRegex = /^[a-z]+:\/\/[^:\/]+(:[0-9]+)?\/(.*?)(\/[0-9]+)?(\?.*)?$/ const uriPath = clip.text.replace(pathRegex, '$2'); const spotifyUri = "spotify:" + uriPath.replaceAll('/', ':') return spotifyUri; }