~ols/ols.wtf

ref: 3796d012023effa7a0bf8860ae67e2ce93d98358 ols.wtf/bin/twitter -rwxr-xr-x 336 bytes View raw
3796d012Oliver Leaver-Smith Use openbsd for build 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
#!/usr/bin/env bash

find dst -name *html* | while read file ; do
echo $file
	title=$(grep "<title>" $file | sed -e 's/.*<title>\(.*\)<\/title>.*/\1/' | sed "s/\&/\\\&/")
	description=$(grep "<h2>" $file | sed -e 's/.*<h2>\(.*\)<\/h2>.*/\1/')
	sed -ibak "s/{{TITLE}}/$title/; s/{{DESCRIPTION}}/$description/" $file
  rm ${file}bak
done