Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
#!/bin/bash
#
# SYNOPSIS -- determine h-number of a person.
# See J. E. Hirsch.
# An index to quantify an individual’s scientific research output.
# http://arxiv.org/pdf/physics/0508025
#
# BUGS: This doesn't handle names with alternate spellings.
#
# AUTHOR: Michael I. Schwartzbach, University of Aarhus, mis@daimi.au.dk
# Modified by Gary T. Leavens (translation to bash,
# deleting temporary files, etc.)
USAGE="$0 'Name Blank Separated' ['subjects blank separated']"
: ${TEMP=/usr/tmp}
# bad arguments?
if test $# -lt 1 -o $# -gt 2
then
echo "$USAGE" >&2
exit 1
fi
# no options allowed
case "$1" in
-*)
echo "$USAGE" >&2
exit 2
;;
esac
name=`echo $1 | tr " " "+"`
# Use the line below for debugging
# echo $name
if test $# -eq 1
then
words='Engineering+Computer+Science+Mathematics'
else
words=`echo $2 | tr " " "+"`
fi
trap 'rm -f $TEMP/google $TEMP/cites' 0
wget -q -U="" -O $TEMP/google 'http://scholar.google.com/scholar?as_q=&num=200&btnG=Search+Scholar&as_epq=&as_oq="'$words'"&as_eq=&as_occt=any&as_sauthors="'$name'"&as_publication=&as_ylo=&as_yhi=&as_allsubj=all&hl=en&lr=&safe=off'
# Use the line below for debugging
# cat $TEMP/google # | tr "<" "\n" | grep "Cited by" | cut -d' ' -f4 | sort -r -n
cat $TEMP/google | tr "<" "\n" | grep "Cited by" | cut -d' ' -f4 | sort -r -n > $TEMP/cites
i=1
for n in `cat $TEMP/cites`
do
if test $i -gt $n
then
i=$(($i - 1))
echo "The h-number of $1 is $i"
exit 0
fi
i=$(($i + 1))
done
echo "The h-number of $1 is zero"