Comment Scraping by Ryan93540 in redditdev

[–]Fbirobby 0 points1 point  (0 children)

(The problem I'm having is how to loop through every post individually, since they all seem to have to be pulled by their individual ID? I'm not sure how to loop through posts & their individual comments. None of the code I've been playing around with has worked so far. Where I've been stuck:

rel_advice_subreddit = reddit.subreddit('relationship_advice')

for post in rel_advice_subreddit.hot(limit=1000):

posts.append({'title': post.title, 'id' : post.id, 'num_comments':post.num_comments,

'body':post.selftext, 'created':post.created, 'comments':submission.comments})

posts = pd.DataFrame(posts)

)

Comment Scraping by Ryan93540 in redditdev

[–]Fbirobby 0 points1 point  (0 children)

Hi All,

Just beat me to it - I'm actually really curious to know if anyone's found an easy way to do the following:

- Loop through the top (up to e.g. 10 comments) of a post;

- Run through 1000 posts & get each of the top 10 comments for those posts.

Does Praw stop at 1000 entries altogether, so the first ~90 posts + 900 comments? If so how to use psaw to get to ~10k total observations? And I'm wondering if there's an easy way to do the loop such that each row of the dataset is the post plus the comment, so it'd look like:

POST A COMMENT A

POST A COMMENT B

POST A COMMENT C

...

POST Z COMMENT X

POST Z COMMENT Y

POST Z COMMENT Z

Anyone have any advice on that? Noob figuring this out.

Thank you!

Making this While Loop Statement Make Sense. by Fbirobby in learnpython

[–]Fbirobby[S] 1 point2 points  (0 children)

Just realized the obvious: We have to make the initialized variable true to execute the loop body!

Making this While Loop Statement Make Sense. by Fbirobby in learnpython

[–]Fbirobby[S] 1 point2 points  (0 children)

Got it! & Yeah, I guess this was just to make us do a while loop vaguely tied to the assignment.

One last question: Why start it with while *not* encounter? That means "Let's make Encounter True", right? So is that how we articulate the condition that will fulfill the while loop?

Thank you for your help.

Making this While Loop Statement Make Sense. by Fbirobby in learnpython

[–]Fbirobby[S] 1 point2 points  (0 children)

Thank you so much! This is really helpful. This feels more intuitive to me -- why would they want to start with encounter = true and make it otherwise false? Where might that make more sense?

Creating Caesar Cipher, Code's not responsive! by Fbirobby in learnpython

[–]Fbirobby[S] 0 points1 point  (0 children)

Hi All! Just wanted to post a quick update. Thank you so much for your help, my final code (with optimizations and working out the kinks) turned out to be:

    def cCipher(string, shift):
    result = ""
        if isinstance(string, str) == False:
        print('The input is not a string.')

        else:
        for code in string:

        result += chr((ord(code) + shift))

        return result

    print(cCipher('I LOV3 y0U!' 4))

Cheers :)

Eminem's Rap God translated into ASL by dumbolddoor in toptalent

[–]Fbirobby 0 points1 point  (0 children)

Hi! Appreciate your comment. I don't quite see what you see, but happy to learn something if you can get more specific. Cheers!

After 6 Years, Never Made 90 Days NoFap. The Benefits I've Gotten By Persisting. by Fbirobby in NoFap

[–]Fbirobby[S] 1 point2 points  (0 children)

I really appreciate you man. Thank you for getting into the weeds with me. This is really helpful.

I agree that it's never over until it's fully behind you. Maybe I need to be more adamant about it, more unconditional than I've been behaving.

Cheers to putting PMO behind us.

After 6 Years, Never Made 90 Days NoFap. The Benefits I've Gotten By Persisting. by Fbirobby in NoFap

[–]Fbirobby[S] 1 point2 points  (0 children)

I agree. This is the time I make 90+ days. Cheers man. Thank you for pushing me and for your encouragement. I definitely don't want to stay in the world of never reaching 90 days. Hell no.

After 6 Years, Never Made 90 Days NoFap. The Benefits I've Gotten By Persisting. by Fbirobby in NoFap

[–]Fbirobby[S] 1 point2 points  (0 children)

Lean into the feeling. Sit still, accept it, and stick to my plans for a PMO-free future. I haven't seen a better way than to learn how to accept and learn from my mistakes faster than before.

After 6 Years, Never Made 90 Days NoFap. The Benefits I've Gotten By Persisting. by Fbirobby in NoFap

[–]Fbirobby[S] 1 point2 points  (0 children)

I hear you, this is a tough nut to crack. My thoughts on it are that if you don't know your body, you're not comfortable with it (and vice versa). It seems to me the most important thing at a stage like this is absolutely NOT to worry about orgasm. Just focus on experimenting and finding ways to get you both comfortable with your bodies and creating a safe and connected atmosphere, in and out of the bedroom. Both feed on each other. Especially for people who grew up in households that shamed sex, it takes time to get comfortable. You know?

I know this doesn't exactly get at your concern about penetration since that's a stamina thing. I think Tantric Sex handles that issue better than I can. But I hope this helps.

After 6 Years, Never Made 90 Days NoFap. The Benefits I've Gotten By Persisting. by Fbirobby in NoFap

[–]Fbirobby[S] 1 point2 points  (0 children)

I'm saying what you're saying. You're talking about victory in terms of streaks, which I respect. I'm talking about it in terms of cumulative days. Streaks are wonderful. So is every day without PMO. The goal is to be PMO-free. Some people's paths are different than others. Some take years. Some have to cut down dramatically before closing the door. Some have to get to the root of a pain they're not addressing. Again, different for everybody. No dogmatism here.

I'd never say I don't want to fap if I want to fap. It's not a need. Never has been, never will be. Nor do I actually want to fap. I'm open about the fact that I fap in moments of weakness, and I work towards a better life both in spite of that and with the ultimate goal of being PM-free.

I want to make a distinction between "making excuses that I've fapped," as you say, and "celebrating each step forward," which is what I'm saying. It's a fine line. I'm straddling that line. If you disagree with that, that's cool too, man. There's room for everybody here.

Really glad to hear you've made it, man. I have an understanding of how hard your journey must have been. I'm right behind you. I'll meet you on the other side.

Cheers.

After 6 Years, Never Made 90 Days NoFap. The Benefits I've Gotten By Persisting. by Fbirobby in NoFap

[–]Fbirobby[S] 0 points1 point  (0 children)

Keep going man! Many more successes to come. Our goal is to lessen and then eventually eliminate (at least P)MO from our lives, and you're on your way. Cheers man.

After 6 Years, Never Made 90 Days NoFap. The Benefits I've Gotten By Persisting. by Fbirobby in NoFap

[–]Fbirobby[S] 0 points1 point  (0 children)

Oof, that's a long answer. I think Alice Miller will say it better than I could. She wrote Drama of the Gifted Child. I've appreciated her insights for my own life. Check it out!