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 options to spare tweets #45

Merged
merged 2 commits into from
Sep 13, 2019
Merged

Conversation

boyvanamstel
Copy link
Contributor

Adds the option to spare tweets by their id_str, favorite_count or retweet_count.

@valenzine
Copy link

valenzine commented Sep 5, 2019

I tried to use this version and I get:

valenzine$ python deletetweets.py -d 2012-01-01 tweet.js --spare-min-likes 10 --spare-min-retweets 5
Traceback (most recent call last):
  File "deletetweets.py", line 112, in <module>
    main()
  File "deletetweets.py", line 108, in main
    delete(args.file, args.date, args.restrict, args.spare_ids, args.min_likes, args.min_retweets)
  File "deletetweets.py", line 77, in delete
    for row in TweetReader(tweets, date, r, s, min_l, min_r).read():
  File "deletetweets.py", line 56, in read
    if row.get("id_str") in self.spare:
TypeError: argument of type 'NoneType' is not iterable

@boyvanamstel
Copy link
Contributor Author

@valenzine Thanks for reporting this. The --spare-ids argument defaults to NoneType instead of an empty array. The last commit resolves the issue.

@valenzine
Copy link

Awesome! Will check it out. Thanks!

@koenrh
Copy link
Owner

koenrh commented Sep 9, 2019

@boyvanamstel Thank you, this is a great addition! I'll merge it later today.

@boyvanamstel
Copy link
Contributor Author

You're welcome Koen. Thanks :)

@koenrh koenrh merged commit 5eb1420 into koenrh:master Sep 13, 2019
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

Successfully merging this pull request may close these issues.

3 participants