aboutsummaryrefslogtreecommitdiffstats
path: root/util/shred/FriendicaOAuth.sh
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-08 22:44:12 -0700
committerfriendica <info@friendica.com>2014-05-08 22:44:12 -0700
commitd3b5509b333f9bfc4641683572039bc8d4eaef88 (patch)
tree6aa1a7da597b19865ba5c137aeee9a79263b7305 /util/shred/FriendicaOAuth.sh
parent831b18cf283cd52fd1b01d6c6c4648b8351985a7 (diff)
downloadvolse-hubzilla-d3b5509b333f9bfc4641683572039bc8d4eaef88.tar.gz
volse-hubzilla-d3b5509b333f9bfc4641683572039bc8d4eaef88.tar.bz2
volse-hubzilla-d3b5509b333f9bfc4641683572039bc8d4eaef88.zip
shred: ability to execute somewhat arbitrary API functions and echo results
Diffstat (limited to 'util/shred/FriendicaOAuth.sh')
-rwxr-xr-xutil/shred/FriendicaOAuth.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/util/shred/FriendicaOAuth.sh b/util/shred/FriendicaOAuth.sh
index 7f368508b..4055e44a9 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
+}