summaryrefslogtreecommitdiff
path: root/scripts/sort_faves.sh
blob: 3daad0bf477d23f239bcdf7d30fa9d5553e37a6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

if [ ! -n "$1" ]
then
  echo "Usage: `basename $0` fav_scores.csv"
  exit
fi

mkdir -p faves

echo "Get the top 50 faves for the Hall of Fame"
sort -t, -k3,3 -rn $1 | head -50 > faves/hall.csv

echo "Group faves by user for popular pages, total fave scores"
sort -t, -k1,1 -r -k3,3 -n $1 > faves/by_user.csv

echo "Group faves by date for daily tallies"
sort -t, -k4,4 -r -k3,3 -n $1 > faves/by_date.csv