Message from @Jacob
Discord ID: 500766682479067137
I'll see if I can make the script automatically run once a day and send me an email with pro-immigration comments and recommended counter arguments
@Jacob perfect MVP to work on. I look forward to seeing it
@ThisIsChris What's the point of searching comment_set over comment_text?
it just made comment_set.intersection({set of keywords}) simpler to write
Does
```
if {"immigrant", "immigration"}.intersection(comment_text)
```
work?
would that work for plurals?
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.
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
but I think it misses a lot of comments, no?
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