-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(main): update the main function to carry out different processes
- Loading branch information
1 parent
9f90ee6
commit 90ad773
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
generateImage, | ||
prepareSvg, | ||
launchPage, | ||
closePage, | ||
processVideo, | ||
} from './video'; | ||
import { getTracksFromSoundcloud } from './audio'; | ||
import { getUnsplashUrl } from './image'; | ||
import { resolve } from 'path'; | ||
|
||
const test = async () => { | ||
launchPage(); | ||
const song = await getTracksFromSoundcloud(); | ||
const svgContent = prepareSvg( | ||
getUnsplashUrl(song.tag_list), | ||
song.title.replace(/(")|(')|(\.)/g, ''), | ||
song.user.username | ||
); | ||
await generateImage(svgContent); | ||
await processVideo(song, resolve(__dirname, '../assets/out.png')); | ||
}; | ||
|
||
test().catch(e => { | ||
console.log('errored'); | ||
console.error(e); | ||
closePage(); | ||
}); |