Hacker News new | ask | show | jobs
by yeahit 6250 days ago
If you use Linux or some other Unix, you can also do it with standard Unix tools:

  wget -O- news.ycombinator.com | grep -o http[^\"]*
Personally, I prefer curl because it writes to stdout per default:

  curl news.ycombinator.com | grep -o http[^\"]*
(After posting this, i noticed that HN cuts * signs at the end of a message. So I have to add this text here, or the last * would not be displayed.)
1 comments

This shows all urls on HN including images etc. whereas the original post demonstrates retrieving only linked articles
You can filter that with another grep for example:

  wget -O- news.ycombinator.com | grep -o 'title"><a href="[^"]*' | grep -o http.*