Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Jeff – Jev-compatible 0.8B decision models, trained at home, ~30 ms (github.com/firelex)
    47comments
  2. Who should be held accountable when an AI Agent (accidentally) acts maliciously? (greenpants.net)
    36comments
  3. Pirating the Pirates (mubi.com)
    193comments
  4. 12,000-year-old Göbeklitepe burials explain scattered bones (archaeologymag.com)
    8comments
  5. MicroLLM Lab – Try 7 tiny LLM's in the browser (stateofutopia.com)
    43comments
  6. World Labs Is Joining AMD (worldlabs.ai)
    46comments
  7. Scientists solve 1840s space weather mystery (arstechnica.com)
    21comments
  8. Hijacking the PS5's RTMP stream (yashgarg.dev)
    54comments
  9. Joseph Szabo’s pictures of American adolescents (newyorker.com)
    35comments
  10. Parley: Federated, decentralised chat that speaks plain IRC (mills.io)
    149comments
  11. Kids turned low-traffic NPR Spotify comments into a secret group chat (thisamericanlife.org)
    148comments
  12. It's Time to Investigate the AI Labs (calnewport.com)
    52comments
  13. Best of British Design (best-of-british-design.vercel.app)
    23comments
  14. What reversing, modernising old games tells us about the economic impact of AI (isfine.org)
    8comments
  15. Flock Wants the Most Detailed Map of Its Surveillance Cameras Taken Offline (theintercept.com)
    43comments
  16. 3D necroprinting: Leveraging biotic material as the nozzle for 3D printing (science.org)
    —discuss
  17. Sonnet 5.5 (anthropic.com)
    344comments
  18. Cf: The Agentic CLI for the Cloudflare API (cloudflare.com)
    42comments
  19. Nvidia wants to put a watchdog chip next to every AI agent (cnbc.com)
    127comments
  20. Show HN: Destroy Any Website with Stickman (spritefusion.com)
    25comments
  21. Does Reddit have an astroturfing problem? What the data suggests (petervijeh.com)
    91comments
  22. First Steps of the PLC Organization – Independent Public Ledger of Credentials (plcred.org)
    18comments
  23. Launch HN: Vespper (YC F24) – SOTA Docx MCP (vespper.com)
    8comments
  24. Who wrote Elizabeth I's most scathing letters? (smithsonianmag.com)
    18comments
  25. What heraldry and Japanese mon can teach about visual-identity generators (benovermyer.com)
    20comments
  26. Updated Google Maps shows destruction of the city of Rafah (twitter.com/aliabunimah)
    36comments
  27. MongoDB CEO resigns to join Meta (reuters.com)
    252comments
  28. Pacing the Frontier is not the actual goal for AI labs (lesswrong.com)
    57comments
  29. GrapheneOS – When an app is slow (wirelessmoves.com)
    41comments
  30. When did Google get so weird? (sancho.bearblog.dev)
    1021comments

Show HN: Bookmarklet to highlight recent comments in a Hacker News thread

1 pointsby 5y ago
1 comments
I find myself often checking into a thread to see the latest replies, which usually means visually scanning for comments that have "minutes" in the timestamp.

I decided to automate this (and a bit extra) with a bookmarklet. Create a new bookmark in your web browser and paste the following into the URL field:

  javascript:(function() {
    const cutoffStr = prompt("Highlight posts in the last:", "1 hour");
    
    function millisForStr(s) {
      const [num, unit] = s.split(' ');
      const parsedNum = Number(num);
    
      return unit.includes('minute') ? parsedNum * 60 * 1000 
        : unit.includes('hour') ? parsedNum * 60 * 60 * 1000 
        : unit.includes('day') ? parsedNum * 24 * 60 * 60 * 1000 
        : NaN;
    }
    
    Array.from(document.querySelectorAll('.age'))
      .map(el => {
        const interval = millisForStr(el.innerText);
    
        return [el, new Date(Date.now() - interval)];
      })
      .forEach(([el, date]) => {
        const cutoff = new Date(Date.now() - millisForStr(cutoffStr));
        if (date >= cutoff) {
          el.parentElement.parentElement.parentElement.style.background = "rgba(255, 215, 0, 0.5)";
        } else {
          el.parentElement.parentElement.parentElement.style.background = null;
        }
      })
  })();
When clicked, you'll be prompted for a string of the form "1 hour" or "23 minutes" or "2 days", and after submitting you'll see all comments on the current page that fall within that interval highlighted with a gold-colored background. Let me know what you think or if you'd like any other small features!
5y agoHN ↗

I wrote once similar one using heat map ages ago (document structure on HN changed at least twice in mean time, I didn't care about being logged in), I always wanted to better it a bit to show (it is color-blind friendly half way - right?, when number of comments is to big regarding vertical resolution don't mind the oldest - right?, shall the bar be on the right side maybe? is it right to add new history entry if clicked on timestamp instead of open comment? etc.) - but now you have to/may enjoy it as it is:

  javascript:
  var n,r='',A=[],a=document.getElementsByClassName("default"); 
  for(i=0;i<a.length;i++){
    n=a[i].firstChild.firstChild.children[1].firstChild;
    if(!n)break; 
    n=n.href;n=n.substring(n.length-8,n.length); 
    A.push({name:n,element:a[i]});
  }   
  A.sort(function(a,b){return b.name-a.name}); 
  var Al=A.length,dh=document.body.clientHeight,ah= dh/Al-1; 
  for(j in A){
    var c=(270/Al)*j+30,l=75+(20/Al)*j,s=100- (80/Al)*j, 
    bc="hsl("+c+","+s+"%,"+l+"%)"; 
    A[j].element.style.backgroundColor=bc; 
    A[j].element.setAttribute('onmouseover',"document.getElementById('map_"+A[j].name+"').style.width='40px'"); 
    A[j].element.setAttribute('onmouseout',"document.getElementById('map_"+A[j].name+"').style.width='20px'");
    A[j].element.setAttribute('onclick',"document.location.href=document.location.href.split('#')[0]+'#up_"+A[j].name+"';return false;");  
    r+="<a id='map_"+A[j].name+"' " 
    +"style='display:block;margin-bottom:1px;width:20px; max-height:"+ah+"px;background-color:"+bc+";' " 
    +"href='#up_"+A[j].name+"' " +"onmouseover=document.location.replace(document.location.href.split('#')[0]+'#up_"+A[j].name+"');return true;>&nbsp;</a>"
  } 
  var sp=document.createElement("div"); 
  sp.setAttribute('style','position:fixed;top:0px;width:80px;height:'+dh+'px;'); 
  document.body.appendChild(sp);sp.innerHTML=r;void('');