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

Basic math / Manipulating dates and times #93

Open
benfishbus opened this issue Apr 29, 2022 · 1 comment
Open

Basic math / Manipulating dates and times #93

benfishbus opened this issue Apr 29, 2022 · 1 comment
Labels

Comments

@benfishbus
Copy link

Is there any way to perform arithmetic in Pipes? I want to convert a time from mm:ss to just seconds. Can I call a webservice like https://api.mathjs.org/ ?

@onli
Copy link
Member

onli commented Apr 29, 2022

Yes. Well, Pipes does not have a block for this. But you can call https://api.mathjs.org/. You just need to feed your target calculation url into a download block.

If you need to take the mm:ss from a different feed then feeding that into a download block is not obvious, as the download block only has a text input. The trick is to use a foreach block, fill it with a download block, and then connect its input with a feed that contains the URLs you want to call.

The result will be combined into one feed and the created download calls will also be properly throttled.

I'm not against adding a new block that does calculations if someone comes up with a usable block layout.

@onli onli added the question label Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants