Klap-in / dokuwiki-plugin-bookcreator

Allow to select some pages and create a book (PDF, ODT or text)

Home Page:https://www.dokuwiki.org/plugin:bookcreator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. Logged in with browser using the "keep me logged in" function and a special user for this purpose
  2. Exported the cookie to cookies.txt
  3. Downloaded the Ebook, viewed the raw data of the request (body) and saved it to a file
  4. 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