darktable + WordPress ?

  1. lua can do this. We could export to a directory, then ftp to the media library.

  2. Not quite sure how to control wordpress remotely and get it to create a post. This one may take some thought.

  3. lua has access to the tags and the image information, so this is easy.

  4. This would need a database change, adding another field to the images table, or another table to keep track of url’s in the case of one picture used on multiple sites. lua can already access image information, so updating another column shouldn’t be a problem (minor code change in the lua image interface).

1 Like

And it would have the benefit from the ability to be updated asynchronously in the case of api changes.

2 Likes

that is not true. i very much question that we have exporters for dubious social media and many of the team have only been medium supportive for these plugins. but dt is a do-ocracy, people implement whatever they think is fun. we rarely pushed back hard on features we consider immoral (face detection).

2 Likes

Ciao Pierre,
my very little contribution.
I own a small personal blog that is built on WordPress.
I choose WP because you can find a lot of plugins, a lot of themes, a lot of hosting offering WP already installed, a huge community of users that posts millions of articles/instructions on the net.
To be short WP is absolutely COMFORTABLE.
I am not a technician, I do not have time to study and learn a solution that involves coding.
I do not have time to study a page structure, a graphic, etc.
It is better if someone [skilled] else will do it for me.
What about safety?
Safety is overall important but how many users will store on their blogs sensitive/personal/important data?
If someone will hack my blog will find some photographs and some stories.
Is this a problem for me? No. My material is already public.
And I have also another question… WHO is actually available to invest time and hack my website? I think nobody…
(by the way - in my opinion - the ‘safety’ argument is nowadays overstimate but this is OT).
As regards publication on WP I see Jetpack plugin has a feature that let you post via e-mail. Maybe you can find some useful information about database fields etc. in its code.
Thanks,
Maurizio

I totally sympathize with proposing static generators for photo blogs over WP. I hope we can all agree that both sides have merits and even if one was a clearly technically superior, it’s still legitimate to like and use the other. Debating those merits is not the intention of the OP and deviates from his intent: Evaluating whether there is demand for a WP exporter from DT and if/how that might be implemented. So citing (somewhat selectively, I do believe it’s fair use though, otherwise rebuke me please)

I think it’s just fair to move the static generator vs WP discussion to another place and let this thread focus on a potential WP exporter in DT.

5 Likes

[quote=“Maurizio_Paglia, post:28, topic:15097, full:true”]
What about safety?
Safety is overall important but how many users will store on their blogs sensitive/personal/important data?
If someone will hack my blog will find some photographs and some stories.
Is this a problem for me? No. My material is already public.
And I have also another question… WHO is actually available to invest time and hack my website? I think nobody…[/quote]

This is not what hackers are interested in or even look at. WP hacking is mostly about installing some functions/scripts on your WP site to send Spam.
If you monitor your WP website you notice that you get constantly hits on plugins your don’t have (hopefully). They look for outdated plugins or themes that they can crack. Best way to stay safe is to update your WP site automatically, it’s also a good idea to rename the /content/ folder so your site does not look like a WP site to a bot.

And who want to invest the time? Correct nobody, automatic bots do the job.

1 Like

WP won’t create a media entry in the database by just uploading the files to the server. It needs an extra step through the Rest API.

You get a Rest API for that, so you can do it using curl and calling the right URL with a JSON file to embed the info. See uploads - Add media with WP-Rest-API v2 II - WordPress Development Stack Exchange

Note that WP has a desktop editing app allowing to post things remotely (which appears to be a modified chromium browser), so remote access is pretty complete.

(I don’t speak Lua).
If you know C and Python, Lua should not be a problem.

I’ve created a skeleton for the Lua script:

What is missing is the command to do the real post and the upload. Now some research is needed how to do it with the command line and curl or any other cml tool. If you post that, I can add that to the script. Or you can do that yourself. :wink:

3 Likes

As much as I’d love to continue the discussion around SSG/CMS, I think @rasimo has a good point, and I should apologize to @anon41087856 for unnecessarily de-railing the conversation. I’m really sorry.

I think a WP exporter is a great idea if you’re willing to try an implement something. There are tons of people who will likely benefit from it and the use case seems reasonably strong (as evidenced by users in this thread who use WP and would probably like an exporter).

4 Likes

I played a little bit with lua several years ago, maybe is a good moment to try to check if I remember something.

Just in case:

2 Likes

This is what I already do. I just use git-annex because of the nature of the files. However, I am talking about a different topic. My topic was automation of result caching to prevent computation on re-export.

Edit: All exporters would then just package the cached pixel data and avoid re-rendering of the same image over and over again.

Ah, I see. Hmmm, I’ll have to think about that for awhile…

1 Like

Thanks a lot ! Having a model is very helpful, I will see if it needs to be tweaked some more for post galleries and such.

@Tobias, here is a docker-compose file that will set up a local wordpress environment that you can access at http://localhost:8080

docker-compose.yml.txt (578 Bytes)

2 Likes

Just launching that project now, @wpferguson or @Tobias do you know if there is a simple way to store username/password in KWallet or Libsecret and fetch it in Lua ?

1 Like

There doesn’t appear to be a simple way. Luarocks, a lua package manager, has lgi, which is a gobject interface and it looks like it will talk to libsecret. Perhaps interfacing with one of the online free password managers?

To interact with WordPress API, instead of using user / password, you can use oauth2.

It’s considered the right way to use remote APIs. The provider, word press in this case, validates the user, and you, as the application, only knows about a token.

Anyway, you have to store the token in a secure place.

Another option is the usage of an API key, a la AWS CLI, but I don’t think it is supported by WordPress (you avoid the burden of oauth2 login, Chevy, redirect,…) .

Bye!

It doesn’t look like WordPress core supports Oauth2. I’m just using the Rest API there, so only looking for a minimal working setup as I need to learn Lua in addition of whispering to unknown API’s ears. But storing passwords in clear text somewhere is something I would prefer to avoid.

So the connection providers that once provided login to Facebook and Flickr were all coded in C ?

1 Like

Yes. They used to be in src/imageio/storage/

The facebook, flickr and google interfaces were all removed because the yearly release cycle of darktable couldn’t keep pace with the API changes, so the storages were broken most of the time. The thought process was to rebuild them in the lua-scripts since it’s not tied to a release schedule in the hopes it could keep up with the API changes.

All of those storages face the same authentication problem that wordpress does, i.e. how to store credentials and access them and then authenticate to <something>.

The good news is that we control the lua API in darktable, so we can leverage the existing credential storage code by extending the API to use it. On the lua side we probably need to code up an authentication library to take care of accessing various services.

I’ll look at the existing c code and start figuring out how to extend the API.

1 Like