Skip to content

Conversation

@jfl88
Copy link

@jfl88 jfl88 commented Jan 5, 2025

I took @braboobssiere's development and also applied it to the handle function as well.

With this change all functions (search, edit, delete) will look at the RateLimit feedback from Reddit API and use it to set the timeout function period. When the response from Reddit is 5 queries remaining or less, it will wait for the reset period to expire before executing again.

@jfl88 jfl88 mentioned this pull request Jan 5, 2025
@jfl88
Copy link
Author

jfl88 commented Jan 5, 2025

Note: this pull request doesn't update version information or anything, I will leave that up to @j0be to decide how to handle any versioning or repo maintenance.

@jokarl
Copy link

jokarl commented Aug 26, 2025

Nice addition! Cleaning up an account with a lot of comments takes a long time when it requires manual intervention in an alert dialog every time it does not respect the rate limit.

@fidelisrafael
Copy link

This is awesome! I was about to try to implement something in this fashion, since I want to let this running while I am not around, and having to confirm on the confirm popup was getting on my way.

I changed the one-line script to point to your branch and changes:

javascript:(function() { window.bookmarkver = '1.4'; var isReddit = document.location.hostname.split('.').slice(-2).join('.') === 'reddit.com'; var isOverview = !! document.location.href.match(/\/overview\b/i); if (isReddit && isOverview) { var cachBustUrl = 'https://raw.githubusercontent.com/j0be/PowerDeleteSuite/194be0e6d795052d6d1b9b35138233f170da29e8/powerdeletesuite.js?' + (new Date().getDate()); fetch(cachBustUrl).then(function(response) { return response.text(); }).then(function(data) { var script = document.createElement('script'); script.id = 'pd-script'; script.innerHTML = data; document.getElementsByTagName('head')[0].appendChild(script); }).catch(function() { alert('Error retrieving PowerDeleteSuite from GitHub'); }); } else if (confirm('This script can only be run from your own user profile on Reddit. Would you like to go there now?')) { document.location = 'https://old.reddit.com/user/me/overview'; } else { alert('Please go to your Reddit profile before running this script'); } })();

Thanks @jfl88

pd.actions.page.next();
}
const timeout = pd.helpers.getRateLimitTimeout(xhr);
console.log('timeout: ' + timeout);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to suggest this to be changed to: console.debug so one can hide these log lines from the main console's output...

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