In this video, we will create a new post via Python.
So for that, I have read it.
Object instance and a subreddits object instance as well.
This time, I'm going to use this subreddit to create a new post here.
It's called pythons and lots.
It's a subreddit where people can post through their bots.
So you can also do this with other subreddits, such as with glassblowing subreddit.
But let's be a good citizen and post in these subreddits here, which is designed to post these kinds
of test submissions.
So to see.
So pythons and a lot, that is what you have to answer in here.
And lots, pythons and lots, that is the subreddits.
Now let's prepare a title for the new post, such as This is my new Python bot submission.
And the contents will be something like, hey, I'm just throwing out Python actually oats just to make
this a multi line string.
So three double codes there.
Delete that.
Three double quotes in here.
Hey, I'm just throwing out Python.
This is my first post.
Then the way to do a submission is by referring to the subreddits where you want to submit and then
use the submit method with title.
And content.
Or you could also say title equals a title and self text equals two content.
So the first argument is title of the second is self text that is content, and that's the title of
the year.
Is this title here?
And that's it.
So just run.
Now, let's ignore this error at the moment and just check for our submission.
So all the reload this.
Page and go to new to filter by new posts.
And if you still don't see your posts, you should go to your profile.
And see the new posts in there, so yeah, this is my post in Python and Lots, so it could take a while
until your post is shown on the subreddit.
Now, if you want to get rid of this error message, you should do what this is suggesting.
So set ready to validate and submit to True.
So under the declaration of war, the subreddits, then you see subreddits that validate or submit through
or run again, this will post the same posts.
But it didn't happen because you see what we get looks like you've been doing events a lot.
Take a break for 12 minutes before trying again.
So, all right, it does have a limit on how often you can post.
You can create new submissions on subreddits, so they do this to avoid abuse with their websites.
So that is a limitation that you need to consider when working with Redis.
As you see, in this case, we have to wait 12 minutes.
So anyway, that is the code to create new submissions on Reddit's next, I'll show you how to create
new comments, how to reply in existing submissions and existing posts.
So see you in the next videos.