1
0
mirror of https://github.com/balkian/bitter.git synced 2024-12-22 08:28:12 +00:00
bitter/bin/extract-users.sh
J. Fernando Sánchez 53bb7edabc Add sh scripts
2018-03-19 14:35:07 +01:00

29 lines
514 B
Bash
Executable File

if [ "$#" -lt 1 ]
then
echo "Usage: $0 <files to convert>"
exit 1
fi
export USER_FIELDS="\$created_at,\
.id_str,\
.screen_name,\
.followers_count,\
.lang,\
.description,\
.statuses_count,\
.favourites_count,\
.friends_count,\
.created_at,\
.name,\
.location,\
.listed_count,\
.time_zone\
"
for i in "$@"
do
OUTPUT=$i.users.csv
echo \#$USER_FIELDS > $OUTPUT
jq -r ".created_at as \$created_at | .user,.retweeted_status.user | select(. != null) | [$USER_FIELDS] | @csv " $i | pv -N "$i" -l >> $OUTPUT
done