a bit more progress on using shred to pick through API results. Commented out because the array storage is kindof weird so the first try (assuming simple arrays) didn't work out. I'll have to rethink how to index these things and may have to rewrite the js() function to do the kinds of things I want.

This commit is contained in:
friendica 2014-05-11 18:36:00 -07:00
parent 045d23a27c
commit 3eae3fd496
2 changed files with 20 additions and 6 deletions

View File

@ -152,7 +152,9 @@ main () {
fcli_in_reply_to_status_id= fcli_in_reply_to_status_id=
fcli_file= fcli_file=
fcli_help_flag= fcli_help_flag=
while getopts "C:c:s:r:f:h" name JS_Fields=()
while getopts "C:c:s:r:f:h:i" name
do do
case $name in case $name in
c) fcli_command="$OPTARG";; c) fcli_command="$OPTARG";;
@ -161,6 +163,7 @@ main () {
r) fcli_in_reply_to_status_id="$OPTARG";; r) fcli_in_reply_to_status_id="$OPTARG";;
f) fcli_file="$OPTARG";; f) fcli_file="$OPTARG";;
h) fcli_help_flag="1";; h) fcli_help_flag="1";;
i) JS_Fields=("${JS_Fields[@]}" "$OPTARG");;
?) usage ?) usage
exit 2;; exit 2;;
esac esac
@ -209,8 +212,19 @@ main () {
;; ;;
*) *)
FO_command $fcli_command FO_command $fcli_command
JS_Parsed=$(echo "$FO_ret" | tokenize | parse) JS_Parsed=$(echo "$FO_ret" | tokenize | parse)
# for a in ${JS_Parsed[@]}; do
# if [ ${#JS_Fields[@]} != 0 ]; then
# for b in ${JS_Fields[@]}; do
# echo "$JS_Parsed" | js ${a} ${b}
# done
# else
echo "$JS_Parsed" echo "$JS_Parsed"
# fi
# done
return $FO_rval return $FO_rval
;; ;;