aboutsummaryrefslogtreecommitdiffstats
path: root/util/shred
diff options
context:
space:
mode:
Diffstat (limited to 'util/shred')
-rwxr-xr-xutil/shred/FriendicaOAuth.sh18
-rwxr-xr-xutil/shred/shred22
2 files changed, 38 insertions, 2 deletions
diff --git a/util/shred/FriendicaOAuth.sh b/util/shred/FriendicaOAuth.sh
index 7f368508b..76858d73c 100755
--- a/util/shred/FriendicaOAuth.sh
+++ b/util/shred/FriendicaOAuth.sh
@@ -171,3 +171,21 @@ FO_statuses_home_timeline () {
return $FO_rval
}
+
+FO_command () {
+ local command="$1"
+
+ local params=(
+ $(OAuth_param 'screen_name' $screen_name)
+ $(OAuth_param 'count' $count)
+ )
+
+
+ local auth_header=$(OAuth_authorization_header 'Authorization' "$redmatrix_url" '' '' 'GET' "${redmatrix_url}/api/${command}.json" ${params[@]})
+
+ convscreen=$(OAuth_PE "$screen_name");
+ FO_ret=$(curl -s --get "${redmatrix_url}/api/${command}.json" --data "screen_name=${convscreen}&count=${count}" --header "${auth_header}")
+ FO_rval=$?
+
+ return $FO_rval
+}
diff --git a/util/shred/shred b/util/shred/shred
index d6fa051c4..9af554032 100755
--- a/util/shred/shred
+++ b/util/shred/shred
@@ -152,7 +152,9 @@ main () {
fcli_in_reply_to_status_id=
fcli_file=
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
case $name in
c) fcli_command="$OPTARG";;
@@ -161,6 +163,7 @@ main () {
r) fcli_in_reply_to_status_id="$OPTARG";;
f) fcli_file="$OPTARG";;
h) fcli_help_flag="1";;
+ i) JS_Fields=("${JS_Fields[@]}" "$OPTARG");;
?) usage
exit 2;;
esac
@@ -208,7 +211,22 @@ main () {
return $FO_rval
;;
*)
- usage 1
+ FO_command $fcli_command
+
+ 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"
+# fi
+# done
+ return $FO_rval
+
;;
esac
return 0