Settings

Theme

Ask HN: Can someone with enough Karma to downvote help me out with snippet?

1 points by markbranly 2 years ago · 6 comments · 1 min read


I'm working on a Hacker News UserStyle that will be a full site redesign but I lack enough karma to downvote.

I got the markup for those in a previous Ask HN [1]. Sadly, I didn't think to ask for markup for something upvoted and something downvoted.

What I need is this snippet (the two table rows that comprise a submission and its actions):

  <tr class="athing" id="123456789">
    <td align="right" valign="top" class="title">
      <span class="rank">10.</span>
    </td>
    <td valign="top" class="votelinks">
      <center>
        <a
          id="up_123456789"
          class="clicky nosee"
          href="vote?id=123456789&amp;how=up&amp;auth=xxxxxx&amp;goto=upvoted%3Fid%3Dmarkbranly"
          ><div class="votearrow" title="upvote"></div
        ></a>
      </center>
    </td>
    <td class="title">
      <span class="titleline"
        ><a href="https://example.com/submission-url/"
          >The Title of the Submission</a
        ><span class="sitebit comhead">
          (<a href="from?site=example.com"><span class="sitestr">example</span></a
          >)</span
        ></span
      >
    </td>
  </tr>
  <tr>
    <td colspan="2"></td>
    <td class="subtext">
      <span class="subline">
        <span class="score" id="score_123456789">100 points</span> by
        <a href="user?id=theusername" class="hnuser">theusername</a>
        <span class="age" title="2024-04-01T00:00:00"
          ><a href="item?id=123456789">20 days ago</a></span
        >
        <span id="unv_123456789"></span> |
        <a href="item?id=123456789">500&nbsp;comments</a>
      </span>
    </td>
  </tr>
 
Thanks for your help. This is the last thing I need and I can't wait to Show HN!

[1] https://news.ycombinator.com/item?id=39791679

bhaney 2 years ago

The downvote arrow is pretty much identical to the upvote arrow markup-wise. It's just another <a> element right after the upvote's <a> element, with the only difference being that the div inside has the "rotate180" class in addition to the "votearrow" class (and a different title/href, but that shouldn't matter to your styling).

If you've upvoted or downvoted, all vote arrows become "nosee"

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection