Is there a reliable way to requestUrl for CSV data? #7083
Unanswered
Evan-Fallon
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
Background
I am a laymen legal and Obsidian enthusiast. I'm not associated with any legal or political entity. Over the last year or so I've been working on a research tool with the goal of making reading and note taking for public legal documents as easy and frictionless as possible for myself.
The tool is being made to reduce the amount of user input required to take notes on legal matters that, themselves, maintain strict and helpful metadata relationships.
Current Functionality
All of this is being made with Obsidian and two prominent community plugins. Templater is used for data conversion, API access, and note creation. Datacore is for react components that display the data and enable user actions. Both of these tools use JSX.
In the current version of the tool, Templater prompts the me for a Courtlistener docket URL, then uses Obsidian's native
requestUrl()function to grab from the free portion of the RestAPI creating a "Docket Note" with all the relevant metadata in YAML format. This is an upgrade from the previous version which involved a series of prompts that I would have to copy paste docket info into.Then I download the CSV with a browser and copy it. Templater converts this to a format that Datacore can read. Then Datacore displays it in table form with links that will prompt Templater to create notes that also have their proper metadata in YAML format.
Current Issue
The problem, beyond being a multi-app dependency, is that this process is not simple on mobile, and if I'm out reading with my tablet/phone, it's a hassle enough to jump through apps to get this done that I often don't bother.
I've had a meeting about the RestAPI solution for this, but the license for the docket-entries portion of the API is currently not financially sustainable given that this is a personal endeavor.
Roadblock
Although it's possible to derive the URL for the CSV data easily from just a docket or document URL with..
../dockets/{id-number}/download..This URL requires you have a logged in session.Using Obsidian's native
requestURL()will return the HTML of the login page, not the CSV data. I have attempted to pass my session cookie in to the request along with some browser data, but haven't been successful in changing this result, though it might be user error.Different iterations of this process have given me instant 200 status, others 202. The wait time for 202s range (depending on how I'm doing this) from 8000ms to 150000ms in order to get a 200 status, but regardless of the wait, all that is returned is the sign in page
Ideal
Even some solution that involves semi-regularly replacing my session cookie as it expires each week or so would still be a huge improvement to this process, and would make usage while out and about possible
My idea scenario, is one where passing a Courtlistener URL in to a function can return the CSV data that I would get having clicked on the button in a browser. This would simplify the docket creation process, and also allow me to add "Update Docket" buttons to existing Docket Pages.
Does anyone have any input or knowledge here that might be helpful, or if there's a different approach that would make sense given my situation? Thank you in advanced!
Evan
Beta Was this translation helpful? Give feedback.
All reactions