Closed vinsworldcom closed 1 year ago
Good idea! Probably a good way to do it is to store "sessions" (probably implemented as a JSON config file mapping session names to arrays of URLs). Since you're the first person to ask for anything related to the grepper form, I'd be curious if you can think of any other improvements I could make.
The most recent commit implements this (minus the "sessions" feature, which doesn't feel like enough of a win to be worthwhile unless someone asks). Other ideas:
// grepperFormStartupActions.json
{
"query": "@.*[:]{foo: @.foo, len_bar: s_len(@.bar)}", // for each URL queried, get a JSON array, from which you select the foo attribute and the length of the bar attribute of each item
"urls": [
"https://foo.gov.api?user=bar",
"https://foo.gov.api?user=baz",
]
}
I'd say the new implementation is a minimum viable product. I don't get the impression that this form is very widely used, and if someone is really unhappy with having to delete the URLs that auto-populate the field (unreasonable IMO because they can just Ctrl+A and then backspace), I might re-implement it in some other way. I'm open to suggestions.
In the "JSON from file and APIs" form, it would be nice to remember - say the last 10 - "Get JSON from APIs" entries and have them auto-populated when the form opens.
I realize just populating that window would mean fetching them all (again) when pressing the "Send requests" button. I think it would be relatively easy to store in the config file up to 5 or 10 most-recently-used URLs. Just how to make them accessible in this window for each recall?
Cheers.