Changeset 13162 for main/waeup.kofa/trunk/docs/source
- Timestamp:
- 11 Jul 2015, 09:34:26 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/docs/source/userdocs/datacenter/export.rst
r13144 r13162 283 283 .. autoattribute:: waeup.kofa.students.export.ComboCardDataExporter.title 284 284 .. automethod:: waeup.kofa.students.export.ComboCardDataExporter.mangle_value() 285 286 File Export 287 =========== 288 289 You want to export files (passport images, pdf slips), for instance 290 of all students in a department or applicants in an applicants 291 container? There is no facility in Kofa which does this job for you, 292 but you can batch-download files by means of your operating system 293 on your local machine. This works perfectly with the the `wget` 294 command on Linux or MacOS computers. Windows does not provide such a 295 command. 296 297 If ``numbers.txt`` contains the application numbers of applicants in 298 the applicants container ``xyz``, the following bash script will 299 download all passport images directly onto you computer:: 300 301 wget --save-cookies cookies.txt --keep-session-cookies --post-data 'form.login=my-username&form.password=my-password' https://my-kofa-site/login 302 303 for i in $(cat numbers.txt) 304 do 305 wget --load-cookies cookies.txt --output-document=$i.pdf https://my-kofa-site/applicants/xyz/$i/passport.jpg 306 done 307 308 If ``numbers.txt`` contains the ids of students in a department, the 309 following bash script will download all passport images directly 310 onto you computer. The script is a slightly extended, more user 311 friendly version of the script above:: 312 313 if [ $# -lt 3 ] 314 then 315 echo "usage: $0 username password filename" 316 exit 1 317 fi 318 319 wget --save-cookies cookies.txt --keep-session-cookies --post-data "form.login=$1&form.password=$2" https://my-kofa-site/login 320 321 while read variable 322 do 323 echo https://my-kofa-site/students/$variable/passport.jpg 324 wget --load-cookies cookies.txt --output-document $variable.jpg https://my-kofa-site/students/$variable/passport.jpg 325 done < $3 326 327
Note: See TracChangeset for help on using the changeset viewer.