mikemcquaid / twitterdelete Goto Github PK
View Code? Open in Web Editor NEW๐ Deleted your old, unpopular tweets (archived)
License: GNU Affero General Public License v3.0
๐ Deleted your old, unpopular tweets (archived)
License: GNU Affero General Public License v3.0
Hi there, thanks for making this open source and sorry this is probably a dumb question.
I put all my api keys into a file called 'secrets.env' in the twitterdelete folder but when i'm running ./twitter_delete.rb --user irl
i get environment variable must be set
Should my keys be in plaintext or have quotes around them like normal ruby strings? i tried both and neither worked. Some help with implementation would be appreciated. Thanks so much!
Had this happen every time so far. I have a stupidly large number of tweets I want to be rid of, so that's perhaps the cause of the issue. Haven't tried other scripts that use the csv file to delete long-since gone-from-the-maximum-visible-limit tweets, so this might not be entirely the fault of the script. Tried with the system Ruby without luck as well.
I was using another tool before yours', but it couldn't delete past the visible-limit, and it wasn't as up-to-date on the API calls as this one, so I switched.
bundle exec ./twitter_delete.rb --user Dom_T4 --csv tweets.csv --force
...
==> Deleting 57439 tweets
/usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/twitter-5.14.0/lib/twitter/rest/request.rb:37:in `rescue in perform': execution expired (Twitter::Error)
from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/twitter-5.14.0/lib/twitter/rest/request.rb:32:in `perform'
from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/twitter-5.14.0/lib/twitter/rest/utils.rb:51:in `perform_request'
from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/twitter-5.14.0/lib/twitter/rest/utils.rb:73:in `perform_request_with_object'
from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/twitter-5.14.0/lib/twitter/rest/utils.rb:65:in `perform_post_with_object'
from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/twitter-5.14.0/lib/twitter/rest/tweets.rb:100:in `block in destroy_status'
from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/twitter-5.14.0/lib/twitter/utils.rb:39:in `block (2 levels) in pmap'
Ever time I run this (in a macOS terminal) I get the following warning:
[DEPRECATION] This gem has been renamed to optimist and will no longer be supported. Please switch to optimist as soon as possible.
I assume something simply needs to be renamed, but it doesn't actually say which gem got renamed... haha.
I'm getting odd errors, presumably from old Tweets the API isn't returning.
/usr/local/lib/ruby/gems/2.3.0/gems/twitter-5.14.0/lib/twitter/rest/response/raise_error.rb:15:in `on_complete': No status found with that ID. (Twitter::Error::NotFound)
from /usr/local/lib/ruby/gems/2.3.0/gems/faraday-0.9.1/lib/faraday/response.rb:9:in `block in call'
from /usr/local/lib/ruby/gems/2.3.0/gems/faraday-0.9.1/lib/faraday/response.rb:57:in `on_complete'
from /usr/local/lib/ruby/gems/2.3.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:in `call'
from /usr/local/lib/ruby/gems/2.3.0/gems/faraday-0.9.1/lib/faraday/request/url_encoded.rb:15:in `call'
from /usr/local/lib/ruby/gems/2.3.0/gems/faraday-0.9.1/lib/faraday/request/multipart.rb:14:in `call'
from /usr/local/lib/ruby/gems/2.3.0/gems/twitter-5.14.0/lib/twitter/rest/request/multipart_with_file.rb:17:in `call'
from /usr/local/lib/ruby/gems/2.3.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
from /usr/local/lib/ruby/gems/2.3.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
from /usr/local/lib/ruby/gems/2.3.0/gems/faraday-0.9.1/lib/faraday/connection.rb:177:in `post'
from /usr/local/lib/ruby/gems/2.3.0/gems/twitter-5.14.0/lib/twitter/rest/request.rb:33:in `perform'
from /usr/local/lib/ruby/gems/2.3.0/gems/twitter-5.14.0/lib/twitter/rest/utils.rb:51:in `perform_request'
from /usr/local/lib/ruby/gems/2.3.0/gems/twitter-5.14.0/lib/twitter/rest/utils.rb:73:in `perform_request_with_object'
from /usr/local/lib/ruby/gems/2.3.0/gems/twitter-5.14.0/lib/twitter/rest/utils.rb:151:in `block in parallel_objects_from_response'
from /usr/local/lib/ruby/gems/2.3.0/gems/twitter-5.14.0/lib/twitter/utils.rb:39:in `block (2 levels) in pmap'
As a fix (and as a feature I like) I also added a parameter to not delete my oldest tweets (as I like having the very old ones there just to brag my account is in the first handful of ones created)
https://github.com/bobbysteel/TwitterDelete/blob/master/twitter_delete.rb
Making a cheeky request for a feature that allows people to not delete specific tweet IDs. Tried coding something myself, but had little progress so far. My Ruby, as we both know, still sucks ๐ข. I'll keep reading the Twitter gem documentation and see if I can come up with something that works with the script though.
Twitter has started sending a fuller archive, with tweets in a tweet.js
file instead of tweets.csv
. It's a plain JS object so probably pretty simple to convert to OpenStruct or even regex it.
When processing an archive file, TwitterDelete comes up with an incorrect tweet count. I think what's happening is tweets from the archive and from the API are being double-counted. The number being reported is approximately 3,000 more than my archive even has.
I'll investigate more, but wanted to file the issue so it wouldn't be lost.
Generates error after bundle install.
"An error occurred while installing unf_ext (0.0.7.4), and Bundler
cannot continue.
Make sure that gem install unf_ext -v '0.0.7.4'
succeeds before bundling."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.