automatic export of pdf using cron - partial solution - featurerequest
ibschreiber opened this issue · comments
Hi,
to achieve a weekly export of a PDF using CRON, I did the following things:
- Logged in with browser using the "keep me logged in" function and a special user for this purpose
- Exported the cookie to cookies.txt
- Downloaded the Ebook, viewed the raw data of the request (body) and saved it to a file
- used curl
curl --cookie cookies.txt --data-binary @params.txt "http://dwserver.my.domain/doku.php?id=wiki:ebook&do=export_pdfbook" >test.pdf
Well, this worked, but:
as soon as the book changes (added pages, page order, etc.), I have to do it again.
The functions are all there to make it working: I'd like to have a parameter called useSavedSelection which allows to export a pdf using the name of a saved selection. This would mean:
curl --cookie cookies.txt "http://dwserver.my.domain/doku.php?id=wiki:ebook&do=export_pdfbook&useSavedSelection=mysavedbook" > test.pdf
And: One last thing: If there was an API-TOKEN like "ASWXAWERNTDSRTGSXENSEXGRSRZNMDRTGXT" we even could skip the user login:
curl "http://dwserver.my.domain/doku.php?id=wiki:ebook&do=export_pdfbook&useSavedSelection=mysavedbook&AUTHTOKEN=ASWXAWERNTDSRTGSXENSEXGRSRZNMDRTGXT" > test.pdf
But maybe I'm missing something and it is already possible in a much easier way?
Ideas? Suggestions?
Kind Regards,
Michael
The token thing is difficult. Better to have there a general mechanism. For example, this issue could result in such a mechanism: dokuwiki/dokuwiki#2431
Exporting saved selections is also suggested in: #97
Hi,
This general approach would be perfect!
Michael