t* hacker news on gopher URI git clone git://git.codevoid.de/hn-gopher DIR Log DIR Files DIR Refs --- DIR commit 2c2402581a0c5564baac9e283a258d07b8df17ed DIR parent 16f8766887021cbcf42e01e6e2100f0d4bd7e316 URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de> Date: Tue, 21 Aug 2018 23:22:53 +0200 Adding archive script, add more blacklist entries Diffstat: A hn-archiver.sh | 23 +++++++++++++++++++++++ M hn-scraper.pl | 11 ++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) --- DIR diff --git a/hn-archiver.sh b/hn-archiver.sh t@@ -0,0 +1,23 @@ +#!/bin/sh + +# lazy ass archiving tool.. + +DIR="/srv/codevoid-gopher/hn" +printf " + _______ __ _______ +| | |.---.-..----.| |--..-----..----. | | |.-----..--.--.--..-----. +| || _ || __|| < | -__|| _| | || -__|| | | ||__ --| +|___|___||___._||____||__|__||_____||__| |__|____||_____||________||_____| + on Gopher (inofficial) +[h|Visit Hacker News on the Web|URL:https://news.ycombinator.com|server|port] + +ARTICLE ARCHIVE SORTED BY ID (highest on top) + +" > $DIR/archive.gph + +for i in $(find $DIR/story_* | sort -r | xargs); do + cat $i >> $DIR/archive.gph; +done + +printf "[1| Back to Hacker News live feed |/hn|server|port]" >> $DIR/archive.gph + DIR diff --git a/hn-scraper.pl b/hn-scraper.pl t@@ -43,7 +43,7 @@ my $logo =" _______ __ _______\n"; $logo .="| || _ || __|| < | -__|| _| | || -__|| | | ||__ --|\n"; $logo .="|___|___||___._||____||__|__||_____||__| |__|____||_____||________||_____|\n"; $logo .=" on Gopher (inofficial)\n"; - $logo .= "[h|Visit Hacker News on the Internet|URL:https://news.ycombinator.com|server|port]\n\n"; + $logo .= "[h|Visit Hacker News on the Web|URL:https://news.ycombinator.com|server|port]\n\n"; ### FUNCTIONS t@@ -282,12 +282,17 @@ sub checkBlacklist { "facebook\.com", "laptopmag\.com", "github\.com", + "bloomberg\.com", "apple\.com", "mjg59\.dreamwidth\.org", "scmp\.com", + "slate\.com", + "nature\.com", + "forbes\.com", "www\.nature\.com", - "www\.reddit\.com", - "old\.reddit\.com" + "tandfonline\.com", + "usebookman\.com", + "reddit\.com" ); foreach my $item (@list) { if( $url =~ m/.*${item}/ ) {