~ols/ols.wtf

ref: ff02e13e09183285064c2920f68905c15aaafd36 ols.wtf/bin/twitter -rwxr-xr-x 320 bytes View raw
ff02e13eOliver Leaver-Smith Merge branch 'master' of git.sr.ht:~ols/ols.wtf 6 months ago
                                                                                
1
2
3
4
5
6
7
8
#!/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
done