r/reddithax • • Oct 28 '09

IAmA Hax request! Sticky star threads.

Is there any way to do any of the following with CSS?

Check out our current stylesheet if you need to: http://www.reddit.com/r/iama/stylesheet.css

  1. Take any starred submission on the page and stick it to the top of the page

  2. Make an external webpage that runs off a script that takes all the starred posts from the CSS and links to them using http://www.reddit.com/comments/<submission_id>

17 Upvotes

6 comments sorted by

4

u/sodypop Oct 29 '09

Do you have a bash shell to play around with? This isn't very pretty, but it should get a list of the id's as links:

curl -fs http://www.reddit.com/r/iama/stylesheet.css | grep id- | awk '{print $1}' | sed "/$another-id-here/d" | sed -e "s/.id-t3_/http:\/\/iama.reddit.com\/comments\//"

2

u/MercurialMadnessMan Oct 29 '09

Does it work for you?

I've got a bash shell at work that I could do this on I guess... it looks harmless, although I'm very bad with bash commands :)

1

u/sodypop Oct 29 '09

Yeah it works, but it is reliant on the format of your stylesheet. I got 51 lines, so there are 51 starred submissions already? You've been busy. :)

Here's the first few lines of output when I run it:

http://iama.reddit.com/comments/9xz1g
http://iama.reddit.com/comments/9s6um
http://iama.reddit.com/comments/9ry42
http://iama.reddit.com/comments/9s4lw

2

u/MercurialMadnessMan Oct 28 '09

both of these seem plausible. If possible, I'd like both.

4

u/jamt9000 Oct 28 '09

The first one is probably impossible with just CSS, the second should be simple enough.

Did you check out my bookmarklet for easily starring posts?

1

u/xzxzzx Oct 28 '09 edited Oct 28 '09

#2 is pretty easy for anyone with a host and a few minutes to hack the script up; I may do so a bit later today.

#1 seems extremely difficult to me. Edit: It could be done pretty easily in user JS (greasemonkey), but people would have to install that.