Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blopa/fc06e367d9753f818b56a02bb55b1a96 to your computer and use it in GitHub Desktop.
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"
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