Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting new values in specific attributes of feed elements #92

Open
benfishbus opened this issue Apr 28, 2022 · 6 comments
Open

Inserting new values in specific attributes of feed elements #92

benfishbus opened this issue Apr 28, 2022 · 6 comments

Comments

@benfishbus
Copy link

I'm trying to make a podcast feed, so I started from one with all the proper elements and am replacing various URLs and other content pulled from webpages. The enclosure element has three attributes: length, url, type. I'm trying to Insert a URL (the sole contents of content:encoded element) in place of the one currently in this url attribute, but it's not working - it just inserts at the root of enclosure element. Is it not possible to insert into a specific attribute of an element? I have tried a bunch of different selector syntax.

@onli
Copy link
Member

onli commented Apr 29, 2022

I think you are right. I don't see this working currently with the insert block. I think the logical solution would be something like //enclosure/content:encoded/@url, but also in my tests this just had no effect.

Do you agree that this is the right syntax? Then I would try to extend the insert block for that. But I'm open for alternatives.

There should already be a workaround: Extract //enclosure/content:encoded, use the replace block to add the url and then insert that new block at the old position. But that's admittedly a bit cumbersome.

@benfishbus
Copy link
Author

After some more testing, it turns out I can insert to URL attribute of enclosure element using xpath //enclosure/@url. That answers my specific question here, but leads to another problem: It inserts the same URL in all the feed items. I'm not sure if/how I would use ForEach to solve this.

@onli
Copy link
Member

onli commented May 1, 2022

I'm surprised the URL attribute could be targeted. Could you link me to an example pipe please? If you don't want to share it publicly you could email me at support@pipes.digital.

It inserts the same URL in all the feed items. I'm not sure if/how I would use ForEach to solve this.

Right, the insert block currently only selects the very first element. I doubt that this is solvable with the current set of block. Maybe the foreach block could be extended to support this usecase. Or maybe the behaviour of the insert block has to change, it is strange that is only inserts one single element.

@benfishbus
Copy link
Author

https://www.pipes.digital/pipe/d918Kbqx

Yes, if Insert block could be dropped into ForEach, would be good.

@onli
Copy link
Member

onli commented May 5, 2022

By now I think the insert block needs to change its default behaviour and add each input input item, not only the first. The old behaviour should be toggleable, and set as default for existing pipes.

@anewuser
Copy link
Contributor

anewuser commented Jul 22, 2022

The new Feedburner makes easy it to turn links into podcast enclosures and configure iTunes tags. It is still being rolled out, though. You should be able to use it within the next days or weeks:

New Feedburner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants