git ssb

0+

cel / ggscrape



Commit 8587a7ef0afc0ac2f7e6bf18c7f56c9b2d4eeec6

Add ln_dir option

Charles Lehner committed on 9/12/2014, 6:17:00 PM
Parent: 83739963420642ad8021b66ab2f68cedaa6a99e6

Files changed

ggscrapechanged
ggscrapeView
@@ -15,8 +15,9 @@
1515
1616 opt_verbose=
1717 group_id=
1818 dest_dir=
19 +ln_dir=
1920 cookie_str=
2021
2122 if [[ -n "$GG_COOKIE" ]]; then
2223 cookie_str="$GG_COOKIE"
@@ -100,8 +101,11 @@
100101 temp=$(mktemp)
101102 if req "message/raw?msg=${group_id}/${topic_id}/${msg_id}" -o "$temp"
102103 then
103104 mv "$temp" "$path"
105 + if [[ -n "$ln_dir" ]]; then
106 + ln "$path" "$ln_dir"
107 + fi
104108 else
105109 echo "message ${topic_id}${msg_id} failed to download." >&2
106110 rm "$temp"
107111 fi
@@ -136,17 +140,18 @@
136140 Usage:
137141 ggscrape <group_id> [test]
138142 ggscrape <group_id> topics
139143 ggscrape <group_id> messages <topic_id>
140- ggscrape <group_id> download <directory>
144 + ggscrape <group_id> download <dest_dir>
141145
142146 Options:
143147 -h, --help Show this screen
144148 --version Show version
145149 -v, --verbose Show debug info
146150 -c, --cookie <cookie> Use the given cookie string
147151 -b, --begin <topicnum> Topic number at which to begin downloading
148152 -e, --end <topicnum> Topic number at which to stop downloading
153 + -l, --ln <ln_dir> Hard link email files into this directory
149154
150155 Environmental variables:
151156
152157 GG_COOKIE use as value for --cookie
@@ -166,8 +171,9 @@
166171 -v|--verbose) opt_verbose=1;;
167172 -c|--cookie) cookie_str="$2"; shift;;
168173 -b|--begin) topic_begin="$2"; shift;;
169174 -e|--end) topic_end="$2"; shift;;
175 + -l|--ln) ln_dir="$2"; shift;;
170176 topics) cmd=topics;;
171177 test) cmd=test;;
172178 messages) cmd=messages; topic_id="$2"; shift;;
173179 download) cmd=download; dest_dir="$2"; shift;;

Built with git-ssb-web