Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using praw.ini #15

Closed
pcheng17 opened this issue Feb 8, 2021 · 3 comments
Closed

Using praw.ini #15

pcheng17 opened this issue Feb 8, 2021 · 3 comments

Comments

@pcheng17
Copy link
Contributor

pcheng17 commented Feb 8, 2021

Hey! Have you thought about using a top-level praw.ini to pass in your client id, client secret, and user_agent? See here for its documentation.

Having a section in the praw.ini file that contains the following

[ScraperBot]
client_id = ABCDE
client_secret = 12345
user_agent = ScraperBot

would allow initialization of the Reddit object to simply be reddit = praw.Reddit('ScraperBot'). Plus, it would remove the current need for dotenv.

@iam-abbas
Copy link
Owner

That sounds really convenient! Could you make a PR?

@pcheng17
Copy link
Contributor Author

pcheng17 commented Feb 8, 2021

Will do! Where in the directory structure do you expect you or other users to run the code? I want to make sure I'm putting the praw.ini file in the right spot since it needs to be in the same directory as where you're running the code.

Edit: Nevermind. Looking at how you're reading your config.ini file, it seems like you're running your ticker_counts.py file from your src directory!

@iam-abbas
Copy link
Owner

iam-abbas commented Feb 8, 2021

Added in #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants