45 ms·
cool idea. Can this be done for many sites? like macros that take advantage of the site's own JS.
by jgmmo 13y ago
cool idea. Can this be done for many sites? like macros that take advantage of the site's own JS.
- chengyinliu 13y agoI don't think it would be easy to write a global one for every site, but I think it would be cool to make a community-driven unsubscribe script collection.
- georgemcbay 13y agoWhile there would be some positive aspects of something like that, you'd either have to have it moderated strictly by a trusted moderator or make sure every user understood every line of all code they were executing from the site. The potential for scripts that did very bad things is immense, especially given how easily you can massively obfuscate JavaScript code.
- duncanmcdowell 13y agoTypically. For example, on reddit you can run this in console to downvote everything on a comment thread: $.each($(".down.arrow"), function(index, vote){ $(vote).click(); });
- chengyinliu 13y agoJust curious, is there any reason you used `$.each` instead of `$(".down.arrow").each`?
- hayksaakian 13y agoseems like the more functional-style way of doing it
- k3n 13y agoProtip: you don't even need an each() at all[1]. So the above could be written: $(".down.arrow").click(); 1. http://jsfiddle.net/k6FvQ/ http://jsfiddle.net/k6FvQ/
- bendangelo 13y agoThis won't down vote everything. Votes get throttled, so I guess a setTimeout has to be used.
- k3n 13y agoThey also explicitly state that you are to make no more than 30 requests/minute[1], or restated, no more than once every 2 seconds. 1. https://github.com/reddit/reddit/wiki/API https://github.com/reddit/reddit/wiki/API
- baddox 13y agoThat's for the API. I don't think the official web site counts.
- k3n 13y agoThey also mention Greasemonkey scripts, which is functionally the same as running script from your console, so I believe it'd still apply. Either way, it's probably a good guide to follow if nothing else -- I mean, reddit still has near-daily capacity issues.
- fourstar 13y agoYeah, if there is jQuery or some other library available. Otherwise just fetch jQuery from the console and append it to the page, and do so.
- tlrobinson 13y agoOr, you know, don't use jQuery.