Skip to content

Commit

Permalink
feat(main): update the main function to carry out different processes
Browse files Browse the repository at this point in the history
  • Loading branch information
Buzzertech committed Jun 14, 2019
1 parent 9f90ee6 commit 90ad773
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/index.ts
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();
});

0 comments on commit 90ad773

Please sign in to comment.