Delete favorite tweets (unfav) from your account, delete all favorite tweets (unfav) before the last X days.
Twitter API only return the user’s most recent 3200 favorited tweets.
Google Apps Script has a limitation on the script runtime of 6 min, so it is advisable to schedule a script execution automatically every 15 minutes so as not to exceed the limits of the Twitter API requests.
Create new twitter app and configure API
- Open Twitter's Application Management, and create a new Twitter app.
- Set the permissions of your app to Read and Write.
- Set the required environment variables
Create new Google Apps Script project Google Apps Script
Copy deleteFavs.gs file in you GAS project and configure variables
Execute script and enjoy your life
Configure the following variables:
var TWITTER_USER = 'YOUR TWITTER USER NAME';
var MAX_AGE_IN_DAYS = 30;
var TWEETS_PER_REQUEST = 200;
var CONSUMER_KEY = 'YOUR CONSUMER KEY';
var CONSUMER_SECRET = 'YOUR CONSUMER CONSUMER_SECRET';
var ACCESS_TOKEN = 'YOUR ACCESS TOKEN';
var ACCESS_SECRET = 'YOUR ACCESS SECRET';
variable | description |
---|---|
TWITTER_USER | Twitter username (exclude @) |
MAX_AGE_IN_DAYS | tweets with a date greater than this number, will be deleted |
TWEETS_PER_REQUEST | Number of tweets per API request |
CONSUMER_KEY | The Consumer Key from your Twitter App |
CONSUMER_SECRET | The Consumer Secret from your Twitter App |
ACCESS_TOKEN | The Access Token from your Twitter App |
ACCESS_SECRET | The Access Secret from your Twitter App |
1.0.0
See the LICENSE file for license rights and limitations (GPL-3).