How to use GPT to generate a viral social media post to announce New Youtube Video.

In this blog post, I will show how you can generate social media content describing your new Youtube Video with a couple of lines of Python Code.

TLDR: Give a Youtube URL and you’ll receive a LinkedIn post to announce your new video

I am a content creator on Youtube. The first thing I do after uploading a Video is to Create a Social Media Post describing it to my audience.

Writing announcement posts for socials is not the most fun task. It takes time. Trigers my inner imposter syndrome and leaves me wondering if I should re-shoot my video. That’s why I decided to leverage the language AI to generate a viral social post automatically.

Created a Streamlit Demo to showcase how to do it

Give a Youtube URL and get the Generated Text Describing the Video

So that’s the demo. It’s fun right? 😄

Now let me show you how to use this Package to generate your own video summaries:

Let’s go!

Step 1: Get an API KEY:

Using any Steamship Package requires an API key. If you do not have one, you can create one either by installing the CLI and login using below commands.

Or

Go to https://app.steamship.com create an account and get the API Key.

Step 2: Import Necessary Libraries & Define the Required Arguments

Import the necessary libraries and defined some important constants.

Step 3: Authenticate with Steamship and Create a new instance of the package

Pass the API Key manually to the Steamship library, also create an Instance of the package with the PACKAGE_NAME & INSTANCE_HANDLE

Step 4: Now it’s time to send a Youtube Video URL and get the Results

Get the URL of a Youtube Video to which you want to generate a description and invoke the previously created instance by passing that URL.

From the response collect the “task_id” and “status” which we gonna use it in the further steps.

Step 5: Retrive the Response

Ok finally we are here. It’s time to get the final generated text 🤩.

As your file is being processed the “status” will go from “waiting” to “processing” to “completed” or “failed”. You can check in the progress of your analysis task using the “task_id” by calling the get_status endpoint.

You’ll have to make repeated GET requests until the status converges to “completed” or “failed”. Once the status key is set to “completed”, you’ll see a file key that represents the generated description of your Video.

Final Words:

That’s how simple it is to use my “audio-description” Package and generate social content describing your New Youtube Video.

Do you have a crazy idea of a NLP Usecase 🤯 ? then you can create your own Package and it’s easy to do that. Check out the documentation and get started!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store