Highlighted posts

    Octavia

    Senior Member
    Founding Member
    Silver Star Silver Star Silver Star Silver Star Silver Star
    Joined
    Mar 24, 2025
    Messages
    1,153
    Reaction Score
    3,135

    Steps to Create a Google Cloud Project & Run subreddit checker​


    1. Go to the Google Cloud Console
    2. Create a New Project
      • Click on the project drop-down at the top of the page (next to "Google Cloud").
      • Select New Project.
      • Enter the Project Name (e.g., "Reddit Tracker").
      • Choose your Organization and Location (optional).
      • Click Create.
    3. Enable APIs and Services
      • Go to the Navigation Menu (☰) > APIs & Services > Library.
      • Search for the following APIs and enable them:
        • Google Sheets API
        • Google Drive API
      • Click Enable for each.
    4. Create Service Account Credentials
      • Go to APIs & Services > Credentials.
      • Click + CREATE CREDENTIALS > Service Account.
      • Provide a Name, ID, and Description.
      • Click Create and Continue.
      • Grant it Editor permissions (or specific permissions required for your project).
      • Click Done.
    5. Generate and Download JSON Key
      • After creating the service account, click on it in the Credentials page.
      • Go to the Keys tab and click Add Key > Create New Key.
      • Select JSON and download the key file.
      • Save this file securely and update the path in your script (path/to/credentials.json).
    6. Share the Spreadsheet with the Service Account
      • Open your Google Spreadsheet.
      • Click Share and add the email address of the service account (visible in the JSON key file).
      • Give it Editor access.
    7. Test the Script
      • Ensure all dependencies (praw, gspread, oauth2client) are installed.
      • Run the script and verify updates in the spreadsheet.

    Out put will be like this.
    1743157652927.png


    Code:
    import praw
    import gspread
    from oauth2client.service_account import ServiceAccountCredentials
    import time
    
    # Reddit API Credentials
    REDDIT_CLIENT_ID = 'your_client_id'
    REDDIT_CLIENT_SECRET = 'your_client_secret'
    REDDIT_USERNAME = 'your_username'
    REDDIT_PASSWORD = 'your_password'
    REDDIT_USER_AGENT = 'script:subreddit_checker:v1.0 (by /u/your_username)'
    
    # Google Sheets API Credentials File
    GOOGLE_SHEETS_CREDENTIALS = 'path/to/credentials.json'  # Path to your credentials.json file
    SPREADSHEET_NAME = 'SubredditChecker'  # Name of your Google Spreadsheet
    
    # Initialize Reddit Instance
    reddit = praw.Reddit(
        client_id=REDDIT_CLIENT_ID,
        client_secret=REDDIT_CLIENT_SECRET,
        username=REDDIT_USERNAME,
        password=REDDIT_PASSWORD,
        user_agent=REDDIT_USER_AGENT
    )
    
    # Google Sheets Authentication Scope
    scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
    creds = ServiceAccountCredentials.from_json_keyfile_name(GOOGLE_SHEETS_CREDENTIALS, scope)
    client = gspread.authorize(creds)
    sheet = client.open(SPREADSHEET_NAME).sheet1  # Access the first sheet
    
    def check_subreddit_details(subreddit_name):
        """Fetch subreddit details such as ban status, crosspostability, and members."""
        try:
            subreddit = reddit.subreddit(subreddit_name)
            is_banned = False
            is_crosspost_enabled = subreddit.allow_crosspost
            member_count = subreddit.subscribers
        except Exception as e:
            # If subreddit is banned or inaccessible
            print(f"Error fetching subreddit {subreddit_name}: {e}")
            is_banned = True
            is_crosspost_enabled = 'N/A'
            member_count = 'N/A'
        return is_banned, is_crosspost_enabled, member_count
    
    def update_google_sheet():
        """Read or populate subreddit list in Google Sheet and update with details."""
        print("Fetching subreddit list from Google Sheets...")
        subreddits = sheet.col_values(1)  # Read all values from Column A
    
        # If Column A is empty (excluding headers), populate it with a sample list
        if len(subreddits) <= 1:  # Only the header row exists
            print("Column A is empty. Populating it with sample subreddit names...")
            sample_subreddits = ["AskReddit", "Python", "learnprogramming", "gaming", "worldnews"]
            sheet.update('A2:A{}'.format(len(sample_subreddits) + 1), [[sub] for sub in sample_subreddits])
            subreddits = sheet.col_values(1)
            print("Sample subreddits added to Column A.")
    
        subreddits = subreddits[1:]  # Exclude the header row
    
        # Write headers if they are missing
        headers = ["Subreddit", "Banned", "Crosspost Enabled", "Members"]
        if sheet.cell(1, 2).value != "Banned":
            sheet.insert_row(headers, 1)
    
        # Check and update subreddit details
        for i, subreddit_name in enumerate(subreddits, start=2):  # Start from row 2
            print(f"Working on row {i}: Checking subreddit: {subreddit_name}")
            is_banned, crosspost_enabled, member_count = check_subreddit_details(subreddit_name)
    
            # Update the sheet with the results
            sheet.update_cell(i, 2, "Yes" if is_banned else "No")  # Banned column
            sheet.update_cell(i, 3, "Yes" if crosspost_enabled else "No")  # Crosspost column
            sheet.update_cell(i, 4, member_count)  # Member count
    
            print(f"Finished row {i}: Updated subreddit {subreddit_name}")
            time.sleep(2)  # Avoid hitting rate limits
        print("Google Sheet updated successfully!")
    
    if __name__ == "__main__":
        update_google_sheet()
     
    For slow responses, if you have to use something like Microsoft Teams, set your status to "busy". Corpos will see that and think, "Oh, right, they must be busy because the little red icon says so!"

    These people are really by the book, so if the software tells them you're busy, you must actually be "busy". ;)

    As for missed deadlines, that one is difficult. I used to miss deadlines with stuff all the time because my previous job was really bureaucratic, so if something needed to be taken care of by "the tech department", nothing would actually get done and the deadline would get missed. You best bet is to just find a way to pin it on your manager, like by saying that the manager didn't "manage" you well you enough and that's why you missed it. This works unless your manager's manager (jeez...) is the one who hired them, in which case, they'll defend your manager and blame you anyway. You know, because if their hiring choice is bad, then it makes them look bad.

    Ugh... those environments...
     
    Yes that might Work Sometimes .. but remember these tier 2, tier 3 links are less important, prioritize quantity over quality..

    We use blog comments, web 2.0 for tier 2 & ,,3 links

    These Tiered Link Building is a strategy to increase the value of your backlinks by building links to the sites that link to your site.

    I guess, people still use tier links ..
     
    Back when I used to do those survey sites, it would've been real handy to be able to search wish offers paid out and which ones didn't.

    The way I could tell before was by looking at the exact pay and how long it would take to see the funds. For example, something saying it pays $50 was probably going to be really picky about their survey, so I never wasted my time with those ones. On the other hand, 1 minute surveys that paid $.50 were far more lucrative in the sense that you could use form filling programs to get them done nearly instantly.

    Nice share, by the way!
     
    I'll share my experience with this: I've gotten those connection requests as well. I actually always accept them just to get closer to having 500+ connections.

    Really, I haven't seen much of a real benefit from it other than the fact that I'm getting more connection requests now than I did before.

    A lot of them are just people trying to sell me links or guest posts, which I'm not interested in buying from random people on Linkedin.

    What I was more hoping for was exposure and recruiters reaching out to me as I read about this happening to others. However, it doesn't appear to be the case for me.
     
    Dont got any frens tho. :confused:

    Yea guess I can ask da ppl at the station or sumthin. Thanks for da advice.

    Try YouTube shorts.

    Whatever you do, do the opposite of what @UnusualSubstance says
    I have 15 subs, kind ser.

    Looks like 14 since someone must've unsubbed.

    1000000970.png


    YouTube shorts is insane.

    This channel was supposed to be for sharing business stuff but I just made some random videos because why not and got some views using shorts.
     
    Last edited by a moderator:
    I have a few suggestions for you based on my own personal experience.

    For example, I've used Wise to accept large international payments. I quite liked it because the funds were deposited in my back account the same day.

    PayPal is expensive, but easy to use. I have PayPal integrated with OfficeOutlaw, but the high fees are annoying.

    Stripe is another option, but I don't have much experience using it.
     
Back
Top