summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Ørsted Andresen <bo.andresen@zlin.dk>2007-03-20 10:14:01 +0000
committerBo Ørsted Andresen <bo.andresen@zlin.dk>2007-03-20 10:14:01 +0000
commit6e0b1ec4894d3745a1a4c2c0b7a2beb9c4f43fbf (patch)
treef2c42e67e6277419ca7b81983c2af0039696e384
parent40a52500c0223922a23d477380d462128e1dc0d3 (diff)
downloadwgetpaste-6e0b1ec4894d3745a1a4c2c0b7a2beb9c4f43fbf.tar.gz
Reverse ${service}_REGEX arrays.
-rwxr-xr-xwgetpaste10
1 files changed, 5 insertions, 5 deletions
diff --git a/wgetpaste b/wgetpaste
index 03b5857..ec8f13f 100755
--- a/wgetpaste
+++ b/wgetpaste
@@ -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