Making use of the API

robertlankford
robertlankford's picture

Joined: 2008-08-31
Posts: 2
Posted: Sun, 2008-08-31 22:08

Real newbie here. My question seems so basic, you'd probably assume that I haven't even tried to look this up yet, but I've actually been pounding my head against google for an hour or so already.

Situation
I've used Gallery (1.x) in a Xoops wrapper for years. I, literally, have between 30 and 40 thousand pictures across 1000+ albums. I'd like to ditch the Xoops wrapper altogether and get a Gallery 2.x installation going.

I've given up on the idea of importing from Gallery 1 to Gallery 2, since i have a Xoops version of Gallery 1. I wouldn't know how to begin to reverse engineer the import script to make that work.

And, as you can imagine, I'd hate to import all these pictures with anything less than a programmatic apprach. I'm handy with PHP, get paid as a programmer, and should be able to work my way through importing all my stuff with a script.

I'm using Ubuntu at home now (sort of new to it, long time Windows user ... so that's another wrinkle, but a fun one).

What I Want to Do:
I'd like to be able make use of the API. All the pictures are located on my local hard drive. They are even in folders that would loosely match up to my eventual album structure that I want to create on my server. So, I want to create a script that will loop over all my photo directories and:

1) Create the appropriate album on the server.
2) Upload all the photos in the current folder into the appropriate album on the server.

My problem is that I'm stuck at go. Please don't assume that I need to see step-by-step instructions on how to make this happen. Rather, I would just like some pointers on how to get started. What scripting language would you recommend (Python, PHP, etc.)? How would you invoke the Gallery API from that scripting language? Can you put up a simple example to create a new album ("test")?

-----

Any help is greatly appreciated. Sorry to be such a dunce.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2008-09-01 08:05

The various APIs are written to be used within Gallery core code, modules, themes and embeddings and not for external scripting. That said however, it's possible. See this recent thread:
http://gallery.menalto.com/node/81010

There's also the Gallery Remote protocol that you could use.

 
robertlankford
robertlankford's picture

Joined: 2008-08-31
Posts: 2
Posted: Mon, 2008-09-01 14:57

Ahh. Gallery Remote Protocol -- that's what I needed! Thanks so much for the reply.