summaryrefslogtreecommitdiffstats
path: root/fb.in
diff options
context:
space:
mode:
Diffstat (limited to 'fb.in')
-rw-r--r--fb.in14
1 files changed, 13 insertions, 1 deletions
diff --git a/fb.in b/fb.in
index 3ab25db..cc79e21 100644
--- a/fb.in
+++ b/fb.in
@@ -32,6 +32,8 @@ if [ -z "$XDG_CONFIG_HOME" ]; then
XDG_CONFIG_HOME="$HOME/.config"
fi
+apikey_file="$XDG_CONFIG_HOME/fb-client/apikey"
+
config_file="$XDG_CONFIG_HOME/fb-client/config"
if [ -e "$config_file" ]; then
. "$config_file"
@@ -74,6 +76,10 @@ request_helper() {
helperopts="$helperopts -D"
fi
+ if [ -e "$apikey_file" ]; then
+ helperopts="$helperopts -a $apikey_file"
+ fi
+
if [ "$mode" = "d" ]; then
$libdir/fb-helper $helperopts -u "$url"
fi
@@ -83,7 +89,13 @@ request_helper() {
fi
else
useragent="fb-client/shell-$version"
- curlopts="-# -n -L -A $useragent --speed-time 30 --speed-limit 1 --connect-timeout 10"
+ curlopts="-# -L -A $useragent --speed-time 30 --speed-limit 1 --connect-timeout 10"
+
+ if [ -e "$apikey_file" ]; then
+ curlopts="$curlopts --data-urlencode 'apikey@$apikey_file'"
+ else
+ curlopts="$curlopts -n"
+ fi
if [ "$debug" ]; then
curlopts="$curlopts -v"