Get Wifi Password Hacker Free - Microsoft Store
RouterPassView, free download.
Basic Tutorial
This is a Basic tutorial of how to make a Bot please make sure this bot is for Praw or you can say for Reddit.
Requirements:
- Microsoft Visual Studio
- Python 3.6
- Pip should be Installed
- Windows
Microsoft Visual Studio
Download it from Microsoft store(Legal) Or download it from FileHippo (Illegal I am not responsible if something happens)
Python 3.6
Download it from Official Website for Free
Lets Start
Follow the following steps and You will make a bot
- Open CMD
- Using cd command go the scripts path in Python folder.
cd \ User\ Username\ AppData\ Local\ Programs\ Python\ Python36-32\ Scripts
pip install Praw
- when it is installed.Open Visual Studios
- now make a new file and save it by giving any name like Config
- After this go to Reddit and click on prefences,and there click on apps.Then click on New app.Make sure it should be a script.Now copy Client Id and Client secret
(Note: Client id will be something like XXXXXXXXXXXXXX and Client Secret should be like XXXXXXXXXXXXXXXXXXXX-XXXXXX )
- Copy that
- Now open Visual Studios and Make a new file save it as Tut.py
- Now write following Codes
import PRAW
- and then following
reddit = praw.Reddit(client_id='clientid', client_secret='secret', password='password', user_agent='PrawTut', username='username')
- now add following line
subreddit = reddit.subreddit('python')
- From here, maybe we want to actually see what's going on here. I usually filter using the "hot" sorting, but you can feel free to use rising or controversial if you like.
hot_python = subreddit.hot()
- What this will give you is a bunch of 'submission objects' in the form of a Python generator object, which we can iterate through. To keep things simple, let's limit how many submission objects we get (submission threads in this case). We'll limit to just one:
hot_python = subreddit.hot(limit=1)
- Now we can iterate through this with something like
or submission in hot_python: print(submission) 6607gh
- As you see here, what we have is the submission object's id, but it's not just an id, it's an object that we can do things with. For example:
hot_python = subreddit.hot(limit=1) for submission in hot_python: print(submission.title)
- Note that I re-defined hot_python. That's because it's a generator object, so it's not saved after it's been iterated through. You could convert to list if you wanted to keep it stored in memory, but, in most cases, you wont be doing that, so I am not doing that here.
- Another issue is, as you can see, we did get a title, but if you actually go to the Python subreddit, you will see this is a sticky, posted 3 months ago. We don't really want stickies. Of course, if you are familiar with the subreddit, you could know to just skip the stickies, or we can just check for them:
hot_python = subreddit.hot(limit=3) for submission in hot_python: if not submission.stickied: print(submission.title) hot_python = subreddit.hot(limit=3) for submission in hot_python: if not submission.stickied: print('Title: {}, ups: {}, downs: {}, Have we visited?: {}'.format(submission.title, submission.ups, submission.downs, submission.visited))
- Let's take an obvious action:
subreddit.subscribe()
- This will subscribe us to the Python subreddit. You might be seeing the upvote and downvote and thinking to yourself "jackpot!" Upvotes and downvotes are still meant to be done only by humans and you can still wind up banned for abusing this rule. Information: https://www.reddit.com/dev/api#POST_api_vote
- The reason upvote/downvote exists in the API is in case you wanted to build some sort of Reddit application that other people would use.
*Overall Code should be:
import praw
reddit = praw.Reddit(client_id='Client Id', client_secret='Client.Secret', password='Password', user_agent='Testbot by
u/Marco_Diaz_Svfoe', username='Usename')
subreddit = reddit.subreddit('AskReddit')
conversedict = {} hot_python = subreddit.hot(limit=3)
for submission in hot_python: if not submission.stickied: print('Title: {}, ups: {}, downs: {}, Have we visited?: {}, subid: {}'.format(submission.title, submission.ups, submission.downs, submission.visited, submission.id))
- Now save it and Open cmd in the folder where this file is
- Now use the command
Python Tut.py
- and it will log you in also it will give you the info you want
- This is how to make a simple Bot
Hope you liked the tutorial Please let us know of you have any Question.
submitted by
Marco_Diaz_SVFOE to
EasyLearnProgramming