Amndeep7 / mass_mentioner

Mention reddit users enmass without having to manually create all the comments.
Other
0 stars 0 forks source link

user_agent and monitored_user and integration of the userfile #1

Closed taz434 closed 8 months ago

taz434 commented 2 years ago

Hi, first of all thanks for providing your work. Unfortunately I am not quite clear what I should understand by user_agent? Is the specification of the user_agent and the monitored_user necessary in the .env ? My second question is how exactly I include the file with the usernames. As far as I understand, a yml file containing the usernames that should be mentioned needs to be created. I have also found in the mass_mentioner.py no possible import path for such a file. Unfortunately I didn't understand the part "Usage user side"...

Am grateful for any help

Amndeep7 commented 2 years ago

The useragent is required by reddit - it's basically a line saying where the traffic is coming from. Reddit appears to be down right now so I can't link it via their docs, but here's PRAW's documentation: https://praw.readthedocs.io/en/stable/getting_started/quick_start.html. Make sure to fill out the rest of the .env.template (and rename the file to .env).

The monitored user is also required as it determines whose comments are scraped in order to find the tagging info. I guess you could modify the script to hardcode in your own name if desired, but it'd be far simpler to just put it in the .env.

The script looks for the yaml within the comments of the monitored user. So this is not a hardcoded list/file, but basically whenever the monitored user posts a comment that contains !tag\n\n and then some yaml, the script processes that and creates new comments accordingly.

Hopefully that answers any questions you have. But now for one of my own - outta curiosity, what's your usecase for the mass_mentioner? Also please keep in mind that certain subs (such as /r/anime) prohibit the use of bots/automated actions so be careful for where you're planning on using it.