mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit 5a5dc1598785fba791a415b528f5e2f82e5cb127
parent 4a86bd96407210be6c6c88646617987b8029bb9c
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 30 Mar 2024 17:30:55 +0100

hackernews

Diffstat:
hackernews_top_stories | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/hackernews_top_stories b/hackernews_top_stories @@ -0,0 +1,10 @@ +#!/bin/bash + +# return something if there are hacker news stories with score >1000 +# (see stuff that's really interesting, or major security vulnerabilities) +# very dirty: TODO better parsing, TODO use the API + +curl -s 'https://news.ycombinator.com/news' | grep -B1 'class="score"' | + grep -B1 ">.... points<" | grep 'class="title"' | + sed 's/.*href="http\([^>]*>[^<]*\).*/http\1/g' | sed 's/">/ /g' +