Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add safeguard #14

Open
jfilter opened this issue Jul 14, 2018 · 2 comments
Open

add safeguard #14

jfilter opened this issue Jul 14, 2018 · 2 comments

Comments

@jfilter
Copy link
Contributor

jfilter commented Jul 14, 2018

After my bot went on a rampage to post the same article over and over again (due to Python 2 and UTF8 handling 🙄) , I wrote a safeguard script. It checks for duplicated links in the last 200 tweets. If something is wrong, it wont start trackthenews and also send me an e-mail (the mailing is done in my magic run.sh script). This could also be part of trackthenews with an option such as --safe. What do you think?

The script: https://github.com/jfilter/ifg-ticker/blob/master/safeguard.py

@thisisparker
Copy link
Contributor

I think I'd rather not merge this into master because it makes some assumptions about usage that I don't want to lock in so early. (For example, that you would only want an attached account to tweet any given link once; I can imagine that people could hook up two TTN bots to a single account, or hook it up to their main account, or something like that.)

I'm going to look it over and see if the specific problem you encountered can be better addressed with error handling, or by moving around when the URL gets recorded into the DB? I know you've got #15 in the queue to address the UTF-8 problem, which I'll get to in a sec too!

@jfilter
Copy link
Contributor Author

jfilter commented Jul 18, 2018

But an option does not mean that you have to enable it. We can leave it disabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants