[Journey] Autoblog with Python - OpenAI GPT3 - Wordpress API

tunks

Regular Member
Jr. VIP
Joined
Jul 3, 2011
Messages
356
Reaction score
268
Goals: To get better with Python and if some money jumps off it wouldn't be bad either.

What I build so far (simplified):
- A python script that creates from one given keyword a whole blog article.
- Example: Input: Dogs -> Python Scripts calls openai api to create blog topics. Blog topics will be loaded in a new function thats calls openai api to create the content for each topic.
- If everything is created another function will put it together and format it for Wordpress Gutenberg, like paragraphs, headlines etc.
- A function that links an niche realted picture from pixabay/pexels to the article
- Then it will be pushed to the wordpress api and the blog post is created.


Wordpress
- simple blog
- at the moment still local hosted
- yoast seo
- plugin to automaticly set the feature images of an post with the first image link it finds in the article


Struggles:
- Uploading pictures to the Wordpress API - the api of wordpress is so shitty documented
- putting an featured blog image with API
- GPT 3 loves enumeration like 1. bla bla bla 2.blabla 3.blabla. Didn't find a way to catch it and format it with </br> so that the structure makes sense. Now it will be posted as continuous text.


To-Do's:
- getting a domain and hosting
- setting up google console shit etc.
- adjust the python script so it takes a list of keywords for generation and loops through it
- create first blog

Plan:
- creating 2-3 blog in different niches with up to 10k arctiles per blog


If you have any question or tips feel free to post under this thread.


P.S.
Can anyone recommend a good and cheap hosting for wordpress with not more than 10k articles?
Thats holds some traffic if things will work out or has an easy upgrade function for more power.
 
do you plan to use fresh or expired/age domains for this project?
good luck, following.
 
do you plan to use fresh or expired/age domains for this project?
good luck, following.
Thank you!

I think I will use fresh domains. Don't have any clue about expired and aged domains and don't want to spend hundreds for a domain. Maybe I will look a little bit around for fresh expired domains that are old and don't have to much backlinks, so I would get an old domain but be save that it didn't have any spam abuse on this old domain.
 
Good Luck with your journey.
Do you fine-tune your Ai writer? Can I know some kinds of prompts you use for your AI?
 
A lot to learn from your journey.
Best of luck mate.
 
- GPT 3 loves enumeration like 1. bla bla bla 2.blabla 3.blabla. Didn't find a way to catch it and format it with </br> so that the structure makes sense. Now it will be posted as continuous text.
I have looked into this issue before and found a good script described for openai on github.

I don't know if I can send the github link in the forum
 
I’m doing something very similar to you but editing the blog outline response manually to remove the numbered list and add any relevant keywords. I create single HTML files then bulk upload using a plugin. Need to work on automating the process more and adding images, etc.

Good luck with your journey!
 
I don't know why I can't edit the last reply anymore, it doesn't matter

- Uploading pictures to the Wordpress API - the api of wordpress is so shitty documented
- putting an featured blog image with API
For how to solve these two problems, here's what I did:
- I used the answer on https://stackoverflow.com/questions/52789439/download-image-from-url-and-upload-to-wordpress-media-library to upload the image URL and get the media ID
- Then the media ID obtained from the blog text is uploaded via the https://developer.wordpress.org/rest-api/reference/posts/#create-a-post
- GPT 3 loves enumeration like 1. bla bla bla 2.blabla 3.blabla. Didn't find a way to catch it and format it with </br> so that the structure makes sense. Now it will be posted as continuous text.
I found a project on https://github.com/susieswe/AutoMuseBlogger that will solve your problem
It creates detailed descriptions to openai and keeps an outline of the article

I hope these can help you
 
Good luck with your journey.please update the progress.
Thank you! I will, I think next week I post a new update. Hope to get my blog online next week with new tweaks.


Good Luck with your journey.
Do you fine-tune your Ai writer? Can I know some kinds of prompts you use for your AI?
Thank you! Not planed yet. At the moment I use standard prompts like "generate blog topics for {keyword}", "informatic blog post about {topic}". But I will tweak them when everything else works fine.

A little while ago I responded to another member here about a similar query - you can read the response here

https://www.blackhatworld.com/seo/how-do-you-add-images-on-paa-sites.1443646/#post-15717032
See if it help.

Congratulations on the journey.
Thank you for this! Was reallly helpful. Also the tip with pillow!

Why don't you use the wordpress-xmlrpc library for Python that can help you handle all the things belongs to Wordpress?

For your issue on working with media: https://python-wordpress-xmlrpc.readthedocs.io/en/latest/examples/media.html
Didn't know about that libary! Damn thank you!

A lot to learn from your journey.
Best of luck mate.
Thank you mate!

I’m doing something very similar to you but editing the blog outline response manually to remove the numbered list and add any relevant keywords. I create single HTML files then bulk upload using a plugin. Need to work on automating the process more and adding images, etc.

Good luck with your journey!
Thats nice! You could just embed some images into the html files for the start. "<img src="https://images.pexels.com/photos/31...to=compress&cs=tinysrgb&fit=crop&h=627&w=1200" alt="ALT TEXT">" change id 315134 for what ever photo you like. You also have different options on size etc.
"src": {
"original": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg",
"large2x": "https://images.pexels.com/photos/20...g?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
"large": "https://images.pexels.com/photos/20...22.jpeg?auto=compress&cs=tinysrgb&h=650&w=940",
"medium": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&h=350",
"small": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&h=130",
"portrait": "https://images.pexels.com/photos/20...to=compress&cs=tinysrgb&fit=crop&h=1200&w=800",
"landscape": "https://images.pexels.com/photos/20...to=compress&cs=tinysrgb&fit=crop&h=627&w=1200",
"tiny": "https://images.pexels.com/photos/20...mpress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280"
},

I don't know why I can't edit the last reply anymore, it doesn't matter


For how to solve these two problems, here's what I did:
- I used the answer on Stack Overflow to upload the image URL and get the media ID
- Then the media ID obtained from the blog text is uploaded via the REST API

I found a project on github that will solve your problem
It creates detailed descriptions to openai and keeps an outline of the article

I hope these can help you
This helps me a lot. Thank you!
 
Goals: To get better with Python and if some money jumps off it wouldn't be bad either.

What I build so far (simplified):
- A python script that creates from one given keyword a whole blog article.
- Example: Input: Dogs -> Python Scripts calls openai api to create blog topics. Blog topics will be loaded in a new function thats calls openai api to create the content for each topic.
- If everything is created another function will put it together and format it for Wordpress Gutenberg, like paragraphs, headlines etc.
- A function that links an niche realted picture from pixabay/pexels to the article
- Then it will be pushed to the wordpress api and the blog post is created.


Wordpress
- simple blog
- at the moment still local hosted
- yoast seo
- plugin to automaticly set the feature images of an post with the first image link it finds in the article


Struggles:
- Uploading pictures to the Wordpress API - the api of wordpress is so shitty documented
- putting an featured blog image with API
- GPT 3 loves enumeration like 1. bla bla bla 2.blabla 3.blabla. Didn't find a way to catch it and format it with </br> so that the structure makes sense. Now it will be posted as continuous text.


To-Do's:
- getting a domain and hosting
- setting up google console shit etc.
- adjust the python script so it takes a list of keywords for generation and loops through it
- create first blog

Plan:
- creating 2-3 blog in different niches with up to 10k arctiles per blog


If you have any question or tips feel free to post under this thread.


P.S.
Can anyone recommend a good and cheap hosting for wordpress with not more than 10k articles?
Thats holds some traffic if things will work out or has an easy upgrade function for more power.

Updates:
- Fixed GPT3 Output to be formated in just replaced \n with </br> and it fixed fucked up format.
- Embedding Links for Images for now. Will code it for the next blog project.
- Got a fresh domain + hosting
- some minor fixes in the script
- blog laylout created
- Currently filling the blog with content. Will take it live the next days.
 
Update:

- Blog is live now
- A little bit more than 1k long form articles plus about 200 post scheduled over the next months
- Indexed page are dancing from 1 to 30 sites

Next Steps:
- Improve the code (upload media - test different prompts and settings, etc.)
- Make everything more "human" ( 1-5 pictures per post, 0-2 youtube videos per post, long and short content, add different authors with filled out profiles and pictures)
- finding some niches
- creating new blogs


Other:
Found a PAA Site in my country that is still going strong with duplicate content 1 Mio. monthly traffic (semrush).
Thinking about coping the best 50k sites, questions, keyword etc. and using gpt3 to answer the questions and put them out. But I still have to the the math how much token it would eat up.
 
Back
Top