AI-Powered Fully Automated Blogging in UBot Studio
Look, I have to be honest. This stuff is just getting crazy. With this new AI tech that’s out there, one person can do the work of 10. UBot Studio harnesses all that power, and today I’m gonna show you an example. We’re going to build a bot that writes 10 high quality blogs, and posts them to our blog.
We’ll start out by dragging the ui console view command. This command will change the UBot browser into a console interface, where we can see the output of our bot’s actions.
Next, we’ll drag the config openai command. This will allow us to interact with the advanced artificial intelligence systems from openai. We’ll need to provide our Private Key, which we can get from OpenAI.
Now, we’ll use the connect to wordpress command to connect to our WordPress site. We’ll need to provide our WordPress site URL, username, and Application password.
Now let’s generate some article titles. We’ll drag the set list command, and name it %titles. For the value, we’re going to define a function.
So let’s drag over our define command. we’ll set the name to “get article titles” and we’ll set it to be a function. In our function, we’ll set a variable named #prompt. For the value, we’ll enter “List 10 article titles about UBot Studio
Next, we’ll set the #response variable. For the value, we’ll use the $gpt response function. This function will call the AI engine generate a response.
The response is in the form of a long string, so we need to convert it into a list of titles. To do that, we’ll drag the set list command and set the name to %titles. For the value, we’ll use the $list from text function.
And finally, we’ll drag the return command to output our %titles list, and then we should be good to use our shiny new function.
Alright, back to our main script. Now we can drag our function and set our variable.
With our list, we can use the with each command to iterate through. We’ll use the #title variable to store the current title. For each title, we’ll use the set command to set a variable. We’ll name it #article, and for the value, we’ll need to define another function.
Once again, we’ll drag over a define command. We’ll name it “generate article” and make it a Function. This function is going to have one parameter called #title.
This will be a simple function. Let’s drag over a set command to set the #prompt variable. This variable will store the text of the article prompt. For the value, we’ll use the string “Write an article that has the following title: ” and pass in our #title variable.
Next, we’ll drag over the set command again, and set the #article variable. For the value, we’ll drag over the $gpt response function. This function will generate an article based on our title.
Let’s finish our function with a return command, and set it to the #article variable.
Now we can drag over our $generate article function. We’ll pass in #title as our prompt.
Finally, we can use our title and article to create a post on our blog. We’ll set it to private, so that we can edit it before going live.
And while we’re at it, let’s log our title and article to the console.
Let’s give this a run and see what it looks like. Hey, not bad at all. Note that the point of this isn’t just to fill up the internet with a bunch of low quality articles. The point is to save you time. If I were to really use these, I would go in and edit each article by hand, making sure it says what I want it to. But that’s a lot faster than writing all of these from scratch. Using a tool like this could literally save hours out of your day, giving you more time to do other stuff, which ultimately translates to a business advantage, and a more satisfying life in general. So go have some fun with this, and rocket your business into the new generation of AI assisted growth and success!
ui console view
config openai("YOUR API KEY")
connect to wordpress("YOUR WEBSITE URL","YOUR USERNAME","YOUR APPLICATION PASSWORD")
set list(%titles,$get article titles(),"Local")
with each(%titles,#title) {
set(#article,$generate article(#title),"Local")
create wordpress post(#title,#article,"draft","post",#post id)
log(#article)
}
define $get article titles {
set(#prompt,"List 10 article titles about UBot Studio in JSON format","Local")
set(#response,$gpt response(#prompt,""),"Local")
set list(%titles,$list from text(#response,$new line),"Local")
return(%titles)
}
define $generate article(#title) {
set(#prompt,"Write an article that has the following title: {#title}","Local")
set(#article,$gpt response(#prompt,""),"Local")
return(#article)
}