3 ms·
Show HN: Slight change to HN bookmarklet that might help with headlines
After reading a few comments here: https://news.ycombinator.com/item?id=11921976
I thought I would try to improve the HN bookmarklet code. I think only time will tell if this is an improvement or not. Thoughts? What to try it yourself?
It's not fool proof and I'll have to see if it actually results in me editing submitted story headlines less often or not. It basically takes the substring of the document title from the start until it finds the first hypen (-) or pipe (|) which are what seems like most sites use when appending the site name.
New bookmarklet code:
javascript:window.location="http://news.ycombinator.com/submitlink?u="+encodeURIComponent(document.location)+"&t="+encodeURIComponent(document.title.substring(0,document.title.search(/[-|]/)).trim())