db9bac537912d1783ef39948350673b3a3f26e53
[feisty_meow.git] / scripts / notes / info_overload_report.sh
1
2 # these metrics are how bogged down we are in to-do type items.
3
4 REPORT_FILE="$HOME/cloud/overload_history.txt"
5
6 # given a path, this will find how many items are under it, ignoring svn and git files.
7 function calculate_depth()
8 {
9   local dir="$1"; shift
10   find "$dir" -type f -exec echo \"{}\" ';' | grep -v "\.svn" | grep -v "\.git" | wc -l | tr -d ' '
11 }
12
13 ##############
14
15 # notes are individual files of tasks, usually, although some are combined.
16 note_depth=$(calculate_depth ~/cloud/grunty_notes)
17
18 # unsorted files haven't been categorized yet.
19 unsorted_depth=$(calculate_depth ~/cloud/unsorted)
20
21 # source examples need to be sucked into other places, other codebases.  they are not
22 # supposed to pile up here.
23 source_example_depth=$(calculate_depth ~/cloud/example_source)
24
25 # the list files are web documents with to-do lists.  individual items are marked with <li>.
26 item_depth=$(find ~/cloud/grunty_notes/ -type f -iname "*.html" -exec grep "<li" "{}" ';' | wc -l | tr -d ' ')
27
28 # scan across all appropriately named folders in our folders that live in the "cloud".
29 cloud_project_depth=0
30 for i in ~/cloud/*project* ~/cloud/*research*; do
31   temp_depth=$(calculate_depth $i)
32   cloud_project_depth=$(($cloud_project_depth + $temp_depth))
33 done
34
35 # also snag the files labelled as trivia, since they're still to-dos...
36 cloud_trivia_depth=0
37 for i in ~/cloud/*trivia*; do
38   temp_depth=$(calculate_depth $i)
39   cloud_trivia_depth=$(($cloud_trivia_depth + $temp_depth))
40 done
41
42 ##############
43
44 total_overload=$(($note_depth + $item_depth + $unsorted_depth + $source_example_depth + $cloud_project_depth + $cloud_trivia_depth))
45
46 report="\
47 \n\
48 Current information overload consists of:\n\
49 \n\
50   $note_depth\tnote files\n\
51   $item_depth\tto-do list items\n\
52   $unsorted_depth\tunsorted files\n\
53   $source_example_depth\tsource examples\n\
54   $cloud_project_depth\tcloud projects\n\
55   $cloud_trivia_depth\tcloud trivials\n\
56   -------\n\
57   $total_overload\ttotal items\n\
58 \n\
59 Gathered On: $(date)\n\
60 \n\
61 ##############"
62
63 echo -e "$report" | tee -a "$REPORT_FILE"
64