Message from @Jacob
Discord ID: 500767776772980737
comment_text is a string, so no
intersection is for sets
ah
so I can't check for certain phrases in order?
You can, look at the "white people" condition as an example
oh that's right
I just can't do it as an intersection
right
so, if I want to check for one out of a list of phrases, I just have to use ```and``` a lot?
I mean, I have a list of phrases, and I want to see if one of those phrases is in a comment
that is a straightforward way, a less verbose way would be:
```python
if any(key_phrase in my_string for key_phrase in list_of_phrases)
```
thanks
what do you guys think of DuckDuckGo? I'm sick of google
@Deleted User at first I was hesitant to use it because its owner and founder is a "you know who" but I find DDG gives different results from Google often so it's a good other source to check out. However, if you like Google results and are just worried about privacy then you can use startpage.
@ThisIsChris Any idea why the script skips over some comments?
If I use this, it shows comments that the script didn't find
@Jacob you could be being rate limited. Instead of silently handling the JSONDecodeError try printing the error to see what's happening. One thing you can do to mitigate is add
```python
import time
time.sleep(4)
```
I did try that
Into the while loop
I did time.sleep() with .5, 1, and 2
Try 4
That's the documented rate limit
Wouldn't 4 seconds be enough for a lot of comments to be posted?
Also I think the rate limit is actually 1 request every 2 seconds
Otherwise try printing the JSONDecodeError
E0602:Undefined variable 'JSONDecodeError'
@Jacob I think it's one per 2 seconds if you are using a dev account. One per 4 seconds if not
ah
would be interesting if we could find a way around this
like send requests from 4 different IP addresses
To print the JSONDecodeError rewrite the `except` statement to be
```python
except JSONDecodeError as e:
print(str(e))
```
Well, another way to look it is, do we *need* every comment? Running the script for an hour probably will yield more comments than I have time to respond to anyway.
@Jacob sure that shouldn't be a problem, you just need 4 proxies. Or just get a dev account, which is free and not too hard to set up. But I think from a development focus that it's more important to get your system working on just the comments you find first, and after that worry about increasing the throughput of the comment stream
@Jacob "do we need every comment" exactly
That can be a future development step, first step is just to get it working sometimes, then work on that part later
Ya, the function of the program is "scan Reddit for pro-immigration comments so we can respond to them" not "scan Reddit for literally every pro-immigration comment"
Yeeep
It's probably more important to get the other functionalities working, which, for now, includes,
1. Suggesting counterarguments
2. Sending out emails
oh, another issue is that is still occasionally posts duplicates