Skip to main content
Best answer

RSS feed - truncate images

  • 2 September 2022
  • 1 reply
  • 103 views

Hi there,

 

I’m currently working on a zap to generate a new RSS feed. Working fine… the only action I can’t figure out is: how may I truncate a list of image url’s?

Currently the image line looks like

<enclosure length="0" type="image/jpeg" url="https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151,https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg?q=80&rect=151"/>

But the importer (which will display the image) can’t handle that list of url’s

So I’d like to always get THE ONLY image url without any parameters… e.g.


<enclosure length="0" type="image/jpeg" url="https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg"/>

Any idea or hint how I could solve this?

 

 

Thanks so much in advance
Andreas

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +12

Hi @Griesinho73!

I would use a Formatter step to extract the url and the recreate the html tag manually in the action step. Let me explain what I mean by that…

After the trigger add a Formatter by Zapier step, choose the Event ‘Text’ and the Transform ‘Extract Url v2’. The action will then find the first url in whatever text you use as an input, assuming that there isn’t another url in the RSS feed before the image, it will extract the url so you just get https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg

 

Then, in the step where you need the url, type in the surrounding html tag and insert the extracted url in the correct place eg  <enclosure length="0" type="image/jpeg" url="https://img.br.de/16a67c24-212e-4511-aecb-90ff2169a474.jpeg"/>

 

Will that work in this case? Or are there other factors that we need to work around? Let use know :)