Created
December 25, 2023 14:15
-
-
Save blopa/fc06e367d9753f818b56a02bb55b1a96 to your computer and use it in GitHub Desktop.
Code for post "Creating Instagram Reels coding tutorials automatically with OpenAI's GPT"
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
const generateTutorialViaOpenAi = require('./generate-tutorial-via-openai'); | |
const generateImageForPost = require('./generate-image-for-post'); | |
const generateVideoForPost = require('./generate-video-for-post'); | |
const postVideoToInstagramReels = require('./post-video-to-instagram-reels'); | |
const prompt = require('./prompt'); | |
const generateTutorial = async () => { | |
const reelsCommands = await generateTutorialViaOpenAi(prompt); | |
const { description, commands, files } = reelsCommands.data.choices[0].value; | |
const outputPath = `./output/${Date.now()}`; | |
const thumbnailPath = `${outputPath}/thumbnail.png`; | |
const videoPath = `${outputPath}/video.mp4`; | |
await generateImageForPost( | |
'./assets/background.png', | |
'./assets/foreground.png', | |
description, | |
thumbnailPath | |
); | |
await generateVideoForPost(commands, files, videoPath); | |
await postVideoToInstagramReels(description, videoPath, thumbnailPath); | |
}; | |
generateTutorial(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment