Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

cool idea. Can this be done for many sites? like macros that take advantage of the site's own JS.


I 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.


While 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.


Typically. 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(); });


This won't down vote everything. Votes get throttled, so I guess a setTimeout has to be used.


They 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


That's for the API. I don't think the official web site counts.


They 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.


Just curious, is there any reason you used `$.each` instead of `$(".down.arrow").each`?


Protip: you don't even need an each() at all[1].

So the above could be written:

$(".down.arrow").click();

1. http://jsfiddle.net/k6FvQ/


seems like the more functional-style way of doing it


Yeah, 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.


Or, you know, don't use jQuery.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: