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)
    55comments
  2. Pirating the Pirates (mubi.com)
    199comments
  3. 12,000-year-old Göbeklitepe burials explain scattered bones (archaeologymag.com)
    10comments
  4. MicroLLM Lab – Try 7 tiny LLM's in the browser (stateofutopia.com)
    45comments
  5. World Labs Is Joining AMD (worldlabs.ai)
    48comments
  6. Scientists solve 1840s space weather mystery (arstechnica.com)
    23comments
  7. Hijacking the PS5's RTMP stream (yashgarg.dev)
    55comments
  8. Flock Wants the Most Detailed Map of Its Surveillance Cameras Taken Offline (theintercept.com)
    46comments
  9. Kids turned low-traffic NPR Spotify comments into a secret group chat (thisamericanlife.org)
    150comments
  10. Parley: Federated, decentralised chat that speaks plain IRC (mills.io)
    155comments
  11. Best of British Design (best-of-british-design.vercel.app)
    27comments
  12. It's Time to Investigate the AI Labs (calnewport.com)
    58comments
  13. Joseph Szabo’s pictures of American adolescents (newyorker.com)
    34comments
  14. What reversing, modernising old games tells us about the economic impact of AI (isfine.org)
    8comments
  15. Sonnet 5.5 (anthropic.com)
    348comments
  16. 3D necroprinting: Leveraging biotic material as the nozzle for 3D printing (science.org)
    2comments
  17. Cf: The Agentic CLI for the Cloudflare API (cloudflare.com)
    44comments
  18. Nvidia wants to put a watchdog chip next to every AI agent (cnbc.com)
    129comments
  19. First Steps of the PLC Organization – Independent Public Ledger of Credentials (plcred.org)
    18comments
  20. Does Reddit have an astroturfing problem? What the data suggests (petervijeh.com)
    101comments
  21. Show HN: Destroy Any Website with Stickman (spritefusion.com)
    26comments
  22. Launch HN: Vespper (YC F24) – SOTA Docx MCP (vespper.com)
    8comments
  23. What heraldry and Japanese mon can teach about visual-identity generators (benovermyer.com)
    20comments
  24. Updated Google Maps shows destruction of the city of Rafah (twitter.com/aliabunimah)
    39comments
  25. Who wrote Elizabeth I's most scathing letters? (smithsonianmag.com)
    18comments
  26. ESP32S3 cluster running 1.58-bit (BitNet) Language model (github.com/low-zi-hong)
    —discuss
  27. MongoDB CEO resigns to join Meta (reuters.com)
    254comments
  28. When did Google get so weird? (sancho.bearblog.dev)
    1022comments
  29. GrapheneOS – When an app is slow (wirelessmoves.com)
    41comments
  30. I switched to Brave (kevquirk.com)
    168comments

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('');