First off we need an Open AI account, You can get one of those from here openai.com/api/
Once you're all signed in, click on the top right head to beta.openai.com/account/api-ke… and create a new Secret Key. Keep this page open as you'll need this for the script
Now its time for the Python side of things
Firstly you need to install the OpenAI python library with the instructions from here github.com/openai/openai-…
Next, create a folder, and in there add a text file called post-titles
On each line of this file add your blog post titles
Next up, in the same folder add python file called generate and copy the content from here into that file gist.github.com/shanejones/030…
Once you're all set you can run the script and it will generate all of your content into a CSV called post-content which you can now import into whichever CMS you use
Sometimes you might only get a small bit of content back. If you look at line 26 of the generate script you can see the writing prompt which we're aking the AI. You can try modifying this for different results.
@mackgrenfell posted this a few months back that is a worthy read for helping GPT-3 generate more content based on the prompts you give it.
The generate script could be also modified so that each line in the text files has a heading and a number of subheadings on the same row.
Think of each row as your post structure.
We could get even more advanced with this by making each heading a new writing prompt too.
You could then tweak the loop in the python file to add another loop for the sub headings, generating a much larger content piece with multiple headings.
I've not got around to this yet though🥲
In the generate file you can see some settings on line 29 to 35. These are the main options for OpenAI.
Clicking on the example you can see the an API request section and you should be able to see how to add this to the generate script quite easily.
Finally, when you upload this content onto your sites. Don't forget to proofread. AI is good, its not perfect though.
I'm using Open AI with a 10k page site as a 6 to 12 month test at the moment. I'm don't think I'm ever going to rely on this site to pay the bills🤣
If you liked this thread I tend to do these about once a week at the moment so be sure to give me a follow so you don't miss the next one and maybe give the original thread tweet a RT too. Thanks! twitter.com/shanejones
• • •
Missing some Tweet in this thread? You can try to
force a refresh
✅ Relevant image. Optimised and responsive.
✅ Large title, usually the main keyword
✅ Breadcrumb - make sure to use Breadcrumb Schema
✅ Table of Contents - Longer posts this should be collapsed with a "show table of contents" button
Core Section - We have an introduction section which includes
✅ H2 with a variation on the H1
✅ Large lead paragraph
✅ Bold paragraph that solves the question the page is trying to answer
✅ Continuation paragraph to lead into the rest of the sites content
Here is some more proof. Below you can see the before and after screenshots of my tests and times in the Chrome Network tab.
Caveat: the Finish time never stops on CSS due to external scripts constantly running. The screenshot was when it stabilised though.
Post 3! The game is up! I didn’t really do this. :D
I’m going to show you how in DevTools you can measure the potential gains that can be had by removing bloated scripts. This method is great to get buy-in from other teams before going ahead deleting anything from the code.
Reduce response times from the server - CDN's can help here
Reduce render blocking JS and CSS - try to only load the minimum on a per page basis. Minify, inline and defer are your friend. Check usage using code coverage tool in Dev Tools
— Optimising Largest Contentful Paint - cont.
Imagery - Make sure they are well optimised and compressed. Also keep an eye on those sizes. Look into image CDN's and lazyloading
Preloading - You can use preload the most important elements on your page