This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup as bs | |
from time import sleep | |
HEADERS = {"user-agent": "win64:avatar-scraper:/u/gavin19"} | |
USER_CLS = "_2Q3rLIRb_ij54AEsabVm9L" | |
PAGE_CLS = "_2QinjfjfDTG6Df4_Tb_eRN" | |
MOD_PAGE = "https://new.reddit.com/r/pics/about/moderators/" | |
tmp_page = MOD_PAGE | |
avis = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
userAgent = 'xxx' | |
cID = 'xxx' | |
cSC= 'xxx' | |
userN = 'xxx' | |
userP ='xxx' | |
numFound = 0 | |
reddit = praw.Reddit(user_agent=userAgent, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re, praw, requests | |
from time import sleep | |
def my_robot(query, sub='all', time='all', limit=25): | |
r = praw.Reddit(...) | |
# Get `limit` no. of posts based on `sub`, `query` and `time` | |
posts = [p for p in r.subreddit(sub).search(query, time, limit=limit)] | |
# Compile query pattern for regex search |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os | |
import sys | |
import praw | |
import requests | |
import simplejson | |
from bs4 import BeautifulSoup as BSp | |
import html2text | |
from time import sleep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver import Firefox, FirefoxOptions | |
from selenium.common.exceptions import TimeoutException | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
import praw | |
from time import sleep | |
r = praw.Reddit(...) | |
opts = FirefoxOptions() | |
opts.add_argument("--headless") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
CMT_PHRASE = "some phrase" | |
PARENT_PHRASE = "another phrase" | |
r = praw.Reddit(...) | |
cmt_stream = r.subreddit("pics").stream.comments(skip_existing=True) | |
def check phrase(cmt, parent): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
import time | |
from datetime import datetime | |
from operator import attrgetter | |
def get_posts(subreddit): | |
r = praw.Reddit(...) | |
sub = r.subreddit(subreddit) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
def main(): | |
r = praw.Reddit(user_agent='/u/someuser upvoted counter', | |
client_id='CLIENT_ID', client_secret='CLIENT_SECRET', | |
username='USERNAME', password='PASSWORD') | |
liked = r.user.me().upvoted(limit=None) | |
likes = {} | |
for l in liked: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
SUB = "somesub" # subreddit to watch for comments | |
TO_SKIP = ['HappySilveon', 'AutoModerator'] # list of users to ignore | |
SUBJECT = "Some subject" # required subject for the PM | |
REPLY = "PM content here." # The content of the PM we'll respond with | |
def main(): | |
reddit = praw.Reddit(user_agent='/u/HappySilveon reply script', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import praw | |
import time | |
SKIP = ['tacobellscannon'] # users to skip replies to | |
WORDS = ['aword', 'word2'] # words to match | |
REPLY = "You said, '{0}'. Thanks." # template for replies | |
LAUNCHED = time.time() |
NewerOlder