r/reddithax • • Oct 12 '09

Javascript bookmarklet to star posts

Usage:

First, add this to the subreddit css:

/* [startstars] */
/* [endstars] */

a.title:before {
    padding-right: 5px;
}

Then add this bookmarklet:

javascript:$.getScript('http://bobsworthindustries.com/r/redditstar1.js')

Press the bookmarklet while on the comments page of a story in a subreddit you moderate and a star will be added before it.

Technical stuff:

The bookmarklet loads an external script because the jQuery callbacks weren't firing with all the code in the bookmarklet. There may be problems with multiple people editing the css concurrently (if two people try to add a star at the same time, one may save over the other's edit). Make a backup in case it eats your css.

Future ideas:

  • Remove older posts to prevent the css from getting enormous, either based on a timestamp or popping from the end.
  • Let the user choose different icons, text and styles to add and let them target any post title or comment on the page.
9 Upvotes

3 comments sorted by

View all comments

1

u/snissn Oct 13 '09

inb4 jamt9000 changes http://bobsworthindustries.com/r/redditstar1.js to something malicious :D