Commit 8587a7ef0afc0ac2f7e6bf18c7f56c9b2d4eeec6
Add ln_dir option
Charles Lehner committed on 9/12/2014, 6:17:00 PMParent: 83739963420642ad8021b66ab2f68cedaa6a99e6
Files changed
ggscrape | changed |
ggscrape | |||
---|---|---|---|
@@ -15,8 +15,9 @@ | |||
15 | 15 … | ||
16 | 16 … | opt_verbose= | |
17 | 17 … | group_id= | |
18 | 18 … | dest_dir= | |
19 … | +ln_dir= | ||
19 | 20 … | cookie_str= | |
20 | 21 … | ||
21 | 22 … | if [[ -n "$GG_COOKIE" ]]; then | |
22 | 23 … | cookie_str="$GG_COOKIE" | |
@@ -100,8 +101,11 @@ | |||
100 | 101 … | temp=$(mktemp) | |
101 | 102 … | if req "message/raw?msg=${group_id}/${topic_id}/${msg_id}" -o "$temp" | |
102 | 103 … | then | |
103 | 104 … | mv "$temp" "$path" | |
105 … | + if [[ -n "$ln_dir" ]]; then | ||
106 … | + ln "$path" "$ln_dir" | ||
107 … | + fi | ||
104 | 108 … | else | |
105 | 109 … | echo "message ${topic_id}${msg_id} failed to download." >&2 | |
106 | 110 … | rm "$temp" | |
107 | 111 … | fi | |
@@ -136,17 +140,18 @@ | |||
136 | 140 … | Usage: | |
137 | 141 … | ggscrape <group_id> [test] | |
138 | 142 … | ggscrape <group_id> topics | |
139 | 143 … | ggscrape <group_id> messages <topic_id> | |
140 | - ggscrape <group_id> download <directory> | ||
144 … | + ggscrape <group_id> download <dest_dir> | ||
141 | 145 … | ||
142 | 146 … | Options: | |
143 | 147 … | -h, --help Show this screen | |
144 | 148 … | --version Show version | |
145 | 149 … | -v, --verbose Show debug info | |
146 | 150 … | -c, --cookie <cookie> Use the given cookie string | |
147 | 151 … | -b, --begin <topicnum> Topic number at which to begin downloading | |
148 | 152 … | -e, --end <topicnum> Topic number at which to stop downloading | |
153 … | + -l, --ln <ln_dir> Hard link email files into this directory | ||
149 | 154 … | ||
150 | 155 … | Environmental variables: | |
151 | 156 … | ||
152 | 157 … | GG_COOKIE use as value for --cookie | |
@@ -166,8 +171,9 @@ | |||
166 | 171 … | -v|--verbose) opt_verbose=1;; | |
167 | 172 … | -c|--cookie) cookie_str="$2"; shift;; | |
168 | 173 … | -b|--begin) topic_begin="$2"; shift;; | |
169 | 174 … | -e|--end) topic_end="$2"; shift;; | |
175 … | + -l|--ln) ln_dir="$2"; shift;; | ||
170 | 176 … | topics) cmd=topics;; | |
171 | 177 … | test) cmd=test;; | |
172 | 178 … | messages) cmd=messages; topic_id="$2"; shift;; | |
173 | 179 … | download) cmd=download; dest_dir="$2"; shift;; |
Built with git-ssb-web