News for hackers. Stuff that matters.
Re:The Bash Hackers Wiki by ShorsHammer on Saturday February 22, 2020 @02:24AM (#22389848)
it's python, requests is one of it's many libraries for the purpose, would actually be quite concerned hiring someone who doesn't know the multiple stdlib solutions for this and still claims ability in python.

import json

import urllib.request

tough hey

Re:The Bash Hackers Wiki by heavyset_go on Saturday February 22, 2020 @02:55AM (#22389920)
I'd be as concerned with someone not opting to use what the documentation recommends[1] in lieu of the stdlib, as I would someone who puts together an awkward Bash script to parse JSON instead of just installing the 50kb package for jq.

> The Requests package is recommended for a higher-level HTTP client interface.

[1] https://docs.python.org/3/library/urllib.request.html

Re:The Bash Hackers Wiki by ShorsHammer on Saturday February 22, 2020 @05:33AM (#22390298)
It's a lot easier to hire people than fire them friend.

The documentation recommends nothing of the sort, it's a direction for consumers. We all live in varied and different worlds, how many varied server environments have you been responsible for all at once? Is it really beyond your amazing programming skills to use the tools at hand in every circumstance? Perhaps it's a chance to demonstrate yet another 3rd party tool which fixes non-existent problems.

It's a few bytes difference in your script that is using requests over the numerous and plentiful stdlib options there.

Re:The Bash Hackers Wiki by vaingloriole on Saturday February 22, 2020 @10:23AM (#22391427)
Would never use python in lieu of curl/jq for json handling unless I am writing something more complicated than a shell script. catch 22.
Re:The Bash Hackers Wiki by ShorsHammer on Saturday February 22, 2020 @09:42PM (#22394749)
If it gets the job done good on you.

Each to their own. Simply saying what I would look for.

Have any examples of your apt install jq script? How would you install jq on a few hundred machines also?

I'd be happy to share an example of an out of the box python script that does the same job and works virtually everywhere.