diff options
author | Bo Ørsted Andresen <bo.andresen@zlin.dk> | 2007-03-20 10:14:01 +0000 |
---|---|---|
committer | Bo Ørsted Andresen <bo.andresen@zlin.dk> | 2007-03-20 10:14:01 +0000 |
commit | 6e0b1ec4894d3745a1a4c2c0b7a2beb9c4f43fbf (patch) | |
tree | f2c42e67e6277419ca7b81983c2af0039696e384 | |
parent | 40a52500c0223922a23d477380d462128e1dc0d3 (diff) | |
download | wgetpaste-6e0b1ec4894d3745a1a4c2c0b7a2beb9c4f43fbf.tar.gz |
Reverse ${service}_REGEX arrays.
-rwxr-xr-x | wgetpaste | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -81,9 +81,9 @@ rafb_POST=("" nick desc lang "" cvt_tabs text) osl_POST=(paste=Send poster "" format expiry "" code2) sh_POST=("" poster "" "" "" "" code) # regex'es -ca_REGEX=('s|^.*content="[0-9]\+;\(http://[^/]\+/[0-9]\+\)".*$|\1|p' 's|^\(http://[^/]\+/\)\([0-9]\+\)$|\1raw/\2|') -rafb_REGEX=("" 's|html\?$|txt|') -osl_REGEX=("" 's|^\(http://[^/]\+/\)\([0-9]\+\)$|\1pastebin.php?dl=\2|') +ca_REGEX=('s|^\(http://[^/]\+/\)\([0-9]\+\)$|\1raw/\2|' 's|^.*content="[0-9]\+;\(http://[^/]\+/[0-9]\+\)".*$|\1|p') +rafb_REGEX=('s|html\?$|txt|') +osl_REGEX=('s|^\(http://[^/]\+/\)\([0-9]\+\)$|\1pastebin.php?dl=\2|') ### defaults @@ -255,7 +255,7 @@ post_data() { } get_url() { - local GET="$(eval "echo \"\${${ENGINE}_REGEX[0]}\"")" + local GET="$(eval "echo \"\${${ENGINE}_REGEX[1]}\"")" if [[ -n "${GET}" ]]; then [[ "${1}" == "need_stdout" ]] && return 0 echo "$*" | sed -n "${GET}" @@ -273,7 +273,7 @@ verify_url() { # if possible convert URL to raw convert_to_raw() { - local CONVERT="$(eval "echo \"\${${ENGINE}_REGEX[1]}\"")" + local CONVERT="$(eval "echo \"\${${ENGINE}_REGEX[0]}\"")" if [[ -n "${CONVERT}" ]]; then RAW_URL="$(echo "${URL}" | sed -e "${CONVERT}")" return 0 |