![]() This is totally not important in regard to what I was doing, but just thought I'd share. "more right" I suppose, to return it as an object. On one hand, it feels silly to have an object with one key being the result - just return the value. As a completely unnecessary aside, I struggled a bit with whether or not I should return just the array of images or the object of an array as I did. You can create a copy of my workflow here:, but note that you will need to click "Add App" in the cloudinary_get_cats section to add a Cloudinary connection. Īs a reminder, the modern version of Pipedream's workflow editor is still working on supporting sharing. Anyway, here's the Python code I used - which was very slightly modified from Pipedream's default code: import requestsįolder = pd.steps I didn't check, but I know there's a cap on how high that value can get, so I'll warn folks that my solution may need tweaking if you need to support repeating calls to handle paging. Notice I've specified a max result of 50. in our constructed Cloudinary object and pass the listing base64 encoded image. Turns out, there are multiple ways documented on Cloudinary's support site in this useful article: Listing all assets within a folderįor me, it came down to a URL of the form: In the src/lib/api/index.ts file, well re-export the soon to be created. Ok, so while I don't have to worry about authentication (which to be honest, their SDK makes incredibly easy anyway), I did have to dig a bit to find out how to list images from a folder. I've mentioned this before, but the beauty of this is that Pipedream handles authentication for you (once you log in of course): Unfortunately, none of the built-in actions supported getting a list of images from a folder:įortunately, and as with other services, you can write custom Node/Python code as seen in the screenshot above. I added a step and searched for Cloudinary, and of course, they had stuff! I began by seeing what Pipedream had in terms of Cloudinary support. ![]() Now I need to get my images from the folder. In my case, I defined a key of folder with the value, cats. I've talked about Pipedream quite a bit here, but for those unfamiliar with the service, this is their way of creating a workflow that's executed by an incoming HTTP request.īecause I like my workflows to be as flexible as possible, I specified an "Export Variables" step which is a simple way to define key/value pairs in your workflow. In Pipedream, I created a new workflow with the HTTP trigger. In there, I dragged and dropped a few cat pictures from my personal collection. Here's how I did it.īefore I start talking about code, I began by logging into my Cloudinary account, going into my Media Library, and creating a new folder named cats. So with that in mind, I turned to Pipedream to build a serverless endpoint. While this is directly supported by their SDKs and REST APIs, I needed something that could be used in a public-facing web application. ![]() I was preparing to work on a Cloudinary and Apline post when I realized I needed something before I could build that demo - a list of images in a Cloudinary folder. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |