shithub: rc

Download patch

ref: 3e4f177fb3e100eaea33817ebbb4e373edb7e7b8
parent: a00f4fc027bfb747a9975411218e30b348ab3e17
author: qwx <qwx@sciops.net>
date: Mon Apr 10 18:57:41 EDT 2023

add gibmehrcinap: download latest and greatest from cinap

--- /dev/null
+++ b/bin/gibmehrinap
@@ -1,0 +1,29 @@
+#!/bin/rc
+hget http://felloff.net/usr/cinap_lenrek/music \
+	| awk '
+/mp3/{
+	sub(".*<a href=\"","")
+	sub("\">.*\.mp3</a>","")
+	s = $1
+	sub("\.mp3$", "")
+	if($1 ~ /[^0-9][0-9]+$/)
+		sub("[0-9]+$", "")
+	d[$1] = d[$1] " " h[$1]
+	h[$1] = s
+}END{
+	for(i in h){
+		if(d[i] != " "){
+			split(d[i], a)
+			for(j in a){
+				if(system("test -f " a[j]) == 0){
+					print a[j] >"/fd/2"
+					system("rm " a[j])
+				}
+			}
+		}
+		if(system("test -f " h[i]) != 0)
+			print "http://felloff.net/usr/cinap_lenrek/music/" h[i]
+	}
+}
+' >list
+{tee list | xargs -n 256 dw} && rm list