On Sat, May 12, 2018 at 11:43 AM, Mathieu Lonjaret <[email protected]> wrote: > Hi, > > On 12 May 2018 at 07:19, tswast <[email protected]> wrote: >> I made a script that uses the tinyapi package to download my TinyLetter >> archive, download all the images referenced in it, and save each newsletter >> to a self-contained HTML file (using data uris for embedding the images). >> >> https://gist.github.com/tswast/ff851cd720c7e4703c7c8f8c35602810#file-tinyarchive-py >> >> I just uploaded these files manually to a set I created in perkeep, but I >> lost a bit of metadata that the TinyLetter API returns that might be nice to >> store in perkeep as well. >> >> Is a proper perkeep importer the way to save metadata without having to >> embed it in the HTML contents? > > Sure, you can save any kind of metadata you want, as permanode > attributes usually. > >> Are there examples of perkeep importers >> written in Python which I could adapt for this purpose? > > None of them are in Python, sorry. > >> How are folks >> finding / installing importers that aren't built-in? > > At the moment, importers are not separate processes (though they > probably will, someday), they are just another kind of HTTP handler > (you can view them as "plugins"). > So if you want to write in Python, you indeed probably want to write a > third-party app instead. You can look at the publisher and the > scanning cabinet (both in the "app" directory) as examples of how that > would work.
Or you can just write a normal Python program that's not integrated into perkeepd at all and schedule it to run however you want (cron, systemd, screen session loop, etc). But you'll need to first write a Python client library that speaks the Perkeep protocol to create all the things. Shouldn't be too hard... there's a file upload handler in and a "sign this please" handler both in perkeepd that do the two hard things. All Python would need to do is prepare some JSON and upload it. -- You received this message because you are subscribed to the Google Groups "Perkeep" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
