improve uloc and replace greppagedate with aboutpage
This commit is contained in:
parent
f7da6b7eab
commit
80896fcdce
@ -77,19 +77,25 @@ function istherenewissues() {
|
|||||||
fi
|
fi
|
||||||
echo "$LASTISSUE" > .newjiraissue
|
echo "$LASTISSUE" > .newjiraissue
|
||||||
}
|
}
|
||||||
function greppagedate() {
|
function aboutpage() {
|
||||||
year=$(echo "$*" | egrep -Eo '\b[[:digit:]]{4}\b')
|
year=$(echo "$*" | egrep -Eo '\b[[:digit:]]{4}\b' | head -n1)
|
||||||
if [ -z "$year" ]
|
if [ -z "$year" ]
|
||||||
then
|
then
|
||||||
year=$(curl -sSL "$*" | tr '<' '\r' | \egrep -i "date|datetime" -A 1 | \grep -Eo '\b[[:digit:]]{4}\b' | head -n1)
|
year=$(curl -sSL "$*" | tr '<' '\r' | \egrep -i "date|datetime" -A 1 | \grep -Eo '\b[[:digit:]]{4}\b' | head -n1)
|
||||||
fi
|
fi
|
||||||
|
author=$(curl -sSL "$*" | tr '<' '\r' | \egrep -i "author" | \grep -Eo '([A-Z][A-Za-z]+\s[A-Za-z]+)' | head -n1)
|
||||||
yearint=$(($year + 0))
|
yearint=$(($year + 0))
|
||||||
currentyear=$(echo `date +"%Y"`)
|
currentyear=$(echo `date +"%Y"`)
|
||||||
|
if [ ! -z "$author" ]
|
||||||
|
then
|
||||||
|
echo "by $author"
|
||||||
|
fi
|
||||||
if [[ $yearint -ge 1970 && $yearint -le $currentyear ]]
|
if [[ $yearint -ge 1970 && $yearint -le $currentyear ]]
|
||||||
then
|
then
|
||||||
echo "$yearint"
|
echo "$yearint"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Extract a column from a tabular output
|
# Extract a column from a tabular output
|
||||||
# via https://blog.developer.atlassian.com/ten-tips-for-wonderful-bash-productivity/
|
# via https://blog.developer.atlassian.com/ten-tips-for-wonderful-bash-productivity/
|
||||||
function col() {
|
function col() {
|
||||||
@ -112,7 +118,7 @@ function uloc {
|
|||||||
-o -name '*.java' \
|
-o -name '*.java' \
|
||||||
-o -name '*.c' -o -name '*.h' \
|
-o -name '*.c' -o -name '*.h' \
|
||||||
-o -name '*.js' \
|
-o -name '*.js' \
|
||||||
\) -exec cat \{\} \; | sort -u | wc -l
|
\) -exec \cat \{\} \; | sed -e 's/^[ \t]*//;s/[ \t]*$//' | sort -u | wc -l
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find files bigger than X size and sort them by size
|
# Find files bigger than X size and sort them by size
|
||||||
|
Loading…
Reference in New Issue
Block a user