Differences between version 3 and previous revision of CyberLeo/Scraps/GoogleCharts.
Other diffs: Previous Major Revision, Previous Author
| Newer page: | version 3 | Last edited on Sunday, 4 July 2010 20:57:50 | by CyberLeo | Revert |
| Older page: | version 2 | Last edited on Sunday, 4 July 2010 20:25:41 | by CyberLeo | Revert |
@@ -13,5 +13,14 @@
hob=$(( ( ${int} / 64 ) + 1 ))
lob=$(( ( ${int} % 64 ) + 1 ))
printf "%s%s" "$(echo "${ev_map}" | cut -c${hob})" "$(echo "${ev_map}" | cut -c${lob})"
}
+
+src_data() {
+ cat link-20100704.log | awk -F'\t' '{ print $2 "\t" $1 }'
+}
+
+printf "http://chart.apis.google.com/chart?cht=lc&chs=1000x256&chd=e:"; src_data | head -n 768 | while read time rtt
+do
+ int_to_ev $(( ${rtt} / 10 ))
+done
</code>
version 3
Convert integers to Extended Value format (bourne shell):
ev_map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-."
int_to_ev() {
int="${1}"
if [ ! "${int}" ]
then
printf "__"
return
fi
[ "${int}" -lt 0 ] && int=0
[ "${int}" -gt 4095 ] && int=4095
hob=$(( ( ${int} / 64 ) + 1 ))
lob=$(( ( ${int} % 64 ) + 1 ))
printf "%s%s" "$(echo "${ev_map}" | cut -c${hob})" "$(echo "${ev_map}" | cut -c${lob})"
}
src_data() {
cat link-20100704.log | awk -F'\t' '{ print $2 "\t" $1 }'
}
printf "http://chart.apis.google.com/chart?cht=lc&chs=1000x256&chd=e:"; src_data | head -n 768 | while read time rtt
do
int_to_ev $(( ${rtt} / 10 ))
done
