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

Construct and build URLs from JSON #176

Closed
lefuturiste opened this issue Apr 26, 2023 · 5 comments
Closed

Construct and build URLs from JSON #176

lefuturiste opened this issue Apr 26, 2023 · 5 comments

Comments

@lefuturiste
Copy link

lefuturiste commented Apr 26, 2023

Very cool and useful program.
I was wondering:
The very same JSON output that this util give when using --json could be processed by some other program (like jq) and then this program could reconstruct a new URL. I known that we already have the set flag but for some case it could be useful to use jq for more complex manipulation

Examples:
echo "https://example.org/helloworld" | trurl --json | trurl --construct should give the same url

Could this be interesting as a feature of this program?

@bagder
Copy link
Member

bagder commented Apr 27, 2023

I am not entirely convinced this is where we need to go.

That would require the use of a JSON parser library.

Setting components can be done in many ways with set and iterate etc, a JSON "import" can probably not be made to support the same range of features.

But I'm willing to listen to what people say.

@jacobmealey
Copy link
Contributor

Similar to #159, it wouldn't be unreasonable to use a Python script or something to get this feature, and then we wouldn't need to require a JSON parser to build trurl.

@lefuturiste
Copy link
Author

okay, knowing the fact that you don't have a JSON parser I understand that this would be the role of another program or a jq script.

@bagder
Copy link
Member

bagder commented Apr 27, 2023

You would probably write a script to receive JSON from trurl, massage the components anyway you want, and then rather create a new trurl command line to create a new URL again.

@bagder
Copy link
Member

bagder commented Apr 28, 2023

I hear very little love for this idea. Maybe we can reconsider in a future when we know better where trurl has gone.

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

No branches or pull requests

3 participants