I need a couple of JavaScript scripts written, using some NPM libraries. I need them to be both Windows and Mac compatible.
1. SoundCloud track uploader/deleter
Using
https://www.npmjs.com/package/node-soundcloud
I need the script to:
- Store a SoundCloud
username
andpassword
as variables. - Have a function that accepts a
path
to an audio file (.wav and.mp3 compatible at least) as an argument. The path will come to you with forward slashes (the Mac standard), so it may need to be converted to back slashes if operating on Windows. The function should then:
- Check the specified account to determine whether there is already a track with the same name as the file. If there is, delete it.
- Check if the account currently has enough space to upload the file. If not, delete as many of the oldest tracks as necessary to make space. Then upload the file. The track must be uploaded with the "downloadable" option enabled.
2. File/folder creator/deleter
This should also use NPM.
https://www.npmjs.com/package/shelljs
should work. This script needs to:
- Have a function that creates a folder with a specified name in a specified directory.
- The arguments of the function should be
name
andlocation
.
- Have a function that checks a specified directory for any folders that have not had any contents created/modified in the past X days and then recycles/deletes those it finds.
- The arguments should be
location, createdModified, days, recycleDelete
, wherecreatedModified
andrecycleDelete
can be simple integers, 1 for the first option and 0 for the second.
- Have a function that checks a specified directory for any audio files that were not created/modified in the past X days and then recycles/deletes those it finds.
- The arguments should be
location, createdModified, days, recycleDelete
, wherecreatedModified
andrecycleDelete
can be simple integers, 1 for the first option and 0 for the second.
- Have a function that runs a specified file (such as an executable).
- The argument can simply be
path
.
All of the file paths will come using forwardslashes so they may need to be converted to backslashes when operating on Windows.
Thanks for tips
@tipu curate
Upvoted 👌 (Mana: 10/15 - need recharge?)
Congratulations @to-the-sun! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!