### Python Example Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/lasc/authentication_samples/sign_in_with_existing_account.html This Python snippet shows how to implement user sign-in, typically used in backend services or scripts. Ensure necessary libraries are installed. ```python def sign_in_with_existing_account(email, password): """Signs in an existing user with their email and password.""" print(f"Attempting to sign in with email: {email}") # TODO: Implement sign-in logic using email and password # Example: Call an authentication API # try: # user = auth_api.sign_in(email, password) # print(f"Sign in successful: {user}") # # Redirect to dashboard or user profile # except Exception as e: # print(f"Sign in failed: {e}") # # Display error message to the user pass # Example usage: sign_in_with_existing_account('user@example.com', 'password123') ``` -------------------------------- ### Agent Initialization and Start Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/mass_example.html Handles the agent's initialization process, including setting up API endpoints and starting necessary processes. ```javascript function _() { r.e(478).then(r.bind(r, 8778)).then((({ setAsyncAPI: t }) => { t(e), (0, o.Ze)(e.agentIdentifier, "api") })).catch((t => { (0, c.R)(27, t), e.ee.abort() })) } S.RI ? (0, a.GG)((() => _()), !0) : _() ``` -------------------------------- ### Get Installation Details Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/dockets/not_dockets/wawb_646603.html Retrieves and formats installation details, including platform, browser type, Cloudmask version, and a user-agent string. For web mode, it attempts to fetch additional device details. ```javascript a.getInstallationDetail = function() { var b = {platform:a.ENV.platform, browserType:a.ENV.browserType, browserVersion:a.ENV.browserVersion, cloudmaskVersion:a.ENV.version, id:a.ENV.installationDetailId}; window && window.navigator && (b.userAgent = window.navigator.userAgent); b.nickName = b.browserType + " on " + b.platform; a.Ra() && (b.nickName = "Web mode on " + b.nickName); return a.S() ? (window.cmProxy.getDeviceDetails(), u.Be.then(function(a) { a && (b.deviceDetails = a, b.nickName = a.brand ? a.brand.charAt(0).toUpperCase() + a.brand.slice(1) + " " + ``` -------------------------------- ### Chrome Storage Local API Example Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/dockets/not_dockets/wawb_646603.html Demonstrates how to use chrome.storage.local for getting, setting, and removing data. Includes error handling and callback functions. ```javascript function(c, d) { b(c, d[a]); }); }, set:function(a, b, c) { var d = {}; d[a] = b; z.Va(d, c); }, remove:function(a, b) { z.removeAll([a], b); }, getAll:function(b, c) { var d = {}, e = !0, f = []; b.forEach(function(b) { a.ENV.hasOwnProperty(b) ? d[b] = a.ENV[b] : e = !1; f.push(a.cb + b + "JSON"); }); e && c(null, d); chrome.storage.local.get(f, function(a) { if (chrome.runtime.lastError) { return console.log("Failed to fetch " + f + " from storage, error: " + chrome.runtime.lastError), c(chrome.runtime.lastError); } d = l(b, a); c(null, d); }); }, Va:function(a, b) { var c = x(a); chrome.storage.local.set(c, function() { if (chrome.runtime.lastError) { return console.log("Failed to set multiple elements to storage, error: " + chrome.runtime.lastError), b && b(chrome.runtime.lastError); } b && b(); }); }, removeAll:function(b, c) { var d = []; b.forEach(function(b) { d.push(a.cb + b + "JSON"); }); chrome.storage.local.remove(d, function() { if (chrome.runtime.lastError) { return console.log("Failed to remove " + d + " from storage, error: " + chrome.runtime.lastError), c && c(chrome.runtime.lastError); } E(b); c && c(); });}} ``` -------------------------------- ### Start New Relic Agent Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/njsuperctappdiv_p_example.html Use `start` to explicitly initiate the New Relic agent's monitoring. This is an alternative to automatic initialization. ```javascript newrelic.start(); ``` -------------------------------- ### Get Navigation Start Time Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/texag_example.html Retrieves the navigation start time of the page. This is the time when the page started loading. ```javascript function c(){return i} ``` -------------------------------- ### IndexedDB Initialization Example Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/dockets/not_dockets/wawb_646603.html Shows the initialization process for an IndexedDB database named 'env'. Includes event listeners for upgrade, block, error, success, and abort. ```javascript N = function() { function b() { function a() { console.debug("Trying to open env db"); var b = window.indexedDB.open("env", 2); b.addEventListener("upgradeneeded", e); b.addEventListener("blocked", f); b.addEventListener("error", n); b.addEventListener("success", d); b.addEventListener("abort", k); } function d(a) { console.debug("env db onsuccess"); c.db = a.target.result; c.resume(); } function e(a) { console.debug("env db onupgradeneeded"); a.target.result.createObjectStore("objects"); } function f() { console.warn("env db blocked, trying again"); a(); } function k() { console.warn("env db onabort, trying again"); a(); } function n(a) { console.error("Could not open env db", a.target.error); throw a.target.error || Error("error opening env db"); } a(); } var c = new (h("./cm_indexeddb").fh), d = Object.create(F); d.get = function(d, e) { e || (e = p); a.ENV[d] ? e(null, a.ENV[d]) : (c.Id({stores:["objects"], operations:[{operation:"get", arguments: [d], events:{success:function(b) { b = b.target.result; a.ENV[d] = b; e(null, b); }, error:function(a) { e(a.target.error); }}}]}), c.db || b()); }; d.set = function(d, e, f) { f || (f = p); a.ENV[d] = e; c.Id({stores:["objects"], mode:"readwrite", operations:[{operation:"put", arguments: [e, d], events:{success:function(a) { f(null, a.target.result); }, error:function(a) { f(a.target.error); }}}}); c.db || b(); }; return d; }(); ``` -------------------------------- ### JavaScript: Sign In with Google Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/lasc/authentication_samples/sign_in_with_existing_account.html This example shows how to sign in an existing user using their Google account. It requires setting up a Google OAuth provider. ```javascript import { signInWithPopup, GoogleAuthProvider } from "firebase/auth"; const auth = getAuth(); const provider = new GoogleAuthProvider(); signInWithPopup(auth, provider) .then((result) => { // This gives you a Google Access Token. You can use it to access the Google API. const credential = GoogleAuthProvider.credentialFromResult(result); const token = credential.accessToken; // The signed-in user info. const user = result.user; // IdP data available using getAdditionalUserInfo(result) // ... }).catch((error) => { // Handle Errors here. const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. const email = error.customData.email; // The AuthCredential type that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... }); ``` -------------------------------- ### LocalStorage API Example Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/dockets/not_dockets/wawb_646603.html Provides functions to interact with the browser's localStorage for getting, setting, and removing data. Data is stored as JSON strings. ```javascript q = {get:function(b, c) { if (!a.ENV[b]) { var d = window.localStorage[a.ENV.Kb + b + "JSON"]; a.ENV[b + "JSON"] = d ? d : null; a.ENV[b] = d ? JSON.parse(d) : null; } c(null, a.ENV[b]); }, set:function(b, c, d) { a.ENV[b] = c ? c : null; a.ENV[b + "JSON"] = JSON.stringify(c); c ? window.localStorage[a.ENV.Kb + b + "JSON"] = a.ENV[b + "JSON"] : delete window.localStorage[a.ENV.Kb + b + "JSON"]; d && d(); }, remove:function(a, b) { this.set(a, null, b); }, getAll:c, Va:function(a, b) { Object.keys(a).forEach(function(b) { this.set(b, a[b]); }.bind(this)); b && b(); }, removeAll:function(a, b) { a.forEach(function(a) { this.set(a, null); }.bind(this)); b && b(); }} ``` -------------------------------- ### Buffer Creation and Initialization Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/docket_history_reports/ksd_8097.html Demonstrates creating and initializing buffers using alloc, allocUnsafe, and from methods. Includes checks for typed array support. ```javascript s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={ __proto__:Uint8Array.prototype, foo:function(){return 42} },42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by \`buffer\` v5.x. Use \`buffer\` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(t,e,r){return u(t,e,r)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},s.allocUnsafe=function(t){return f(t)},s.allocUnsafeSlow=function(t){return f(t)} ``` -------------------------------- ### Get Folder Parents Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/dockets/not_dockets/wawb_646603.html Retrieves the hierarchy of parent folders for a given element, starting from the element itself up to the root. It uses the local cache to find folder details. ```javascript function ee(a) { a = a || g(); var d = []; if (a && a.recordID && a.fieldID && a.recordID != c.G) { var e = b.Rc(a.recordID, a.fieldID); if (!e) { return x.b("CM298 "), d; } if (!e.usage) { return x.b("CM299 "), d; } e.usage == y.Usage.folder && (e.folderParents && (d = e.folderParents.slice(0)), d.push({recordID:a.recordID, fieldID:a.fieldID})); } return d; } ``` -------------------------------- ### Agent Initialization Configuration Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/massappct_example.html Handles the initial setup and configuration of the agent, including loading configuration and setting runtime parameters. ```javascript function j(e,t={},r,n){let{init:i,info:o,loader_config:a,runtime:c={},exposed:u=!0}=t;c.loaderType=r;const l=(0,d.pV)();o||(i=l.init,o=l.info,a=l.loader_config),(0,S.xN)(e.agentIdentifier,i||{}),(0,I.a)(e.agentIdentifier,a||{}),o.jsAtt ``` -------------------------------- ### Java Example Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/lasc/authentication_samples/sign_in_with_existing_account.html This Java snippet outlines the process for signing in an existing user. It's suitable for enterprise applications and Android development. ```java public class Authentication { public void signInWithExistingAccount(String email, String password) { System.out.println("Attempting to sign in with email: " + email); // TODO: Implement sign-in logic using email and password // Example: Call an authentication API // try { // User user = authApi.signIn(email, password); // System.out.println("Sign in successful: " + user); // // Redirect to dashboard or user profile // } catch (AuthenticationException e) { // System.err.println("Sign in failed: " + e.getMessage()); // // Display error message to the user // } } // Example usage: public static void main(String[] args) { Authentication auth = new Authentication(); auth.signInWithExistingAccount("user@example.com", "password123"); } } ``` -------------------------------- ### Install Juriscraper Source: https://github.com/freelawproject/juriscraper/blob/main/README.rst Install the Juriscraper library using pip. Ensure Python 3.9+ is installed first. ```bash pip install juriscraper ``` -------------------------------- ### Agent Initialization with Feature Flags Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/njtaxct_u_example.html This snippet demonstrates initializing the agent and enabling specific features using configuration flags. Ensure features are enabled before use. ```javascript import { Agent } from "@newrelic/browser-agent"; const agent = new Agent({ info: { licenseKey: "YOUR_LICENSE_KEY", applicationID: "YOUR_APP_ID" }, features: { spa: { enabled: true, auto: true }, page_action: { enabled: true, auto: true } } }); agent.start(); ``` -------------------------------- ### Install Juriscraper Dependencies Source: https://github.com/freelawproject/juriscraper/wiki/MacDevEnvironment Install necessary system and Python dependencies for Juriscraper. Ensure you have libxml2-dev and libxslt-devel installed, along with specific versions of chardet, requests, and lxml. A log directory is also created. ```bash $ sudo pip install libxml2-dev libxslt-devel $ sudo pip install chardet==1.0.1 $ sudo pip install requests==1.2.3 $ sudo pip install lxml==3.0.1 $ sudo mkdir /var/log/juriscraper/ ``` -------------------------------- ### Initialize Window Size Settings Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/state/texas/coa/01-25-00994-CR.html Sets up initial window size settings and an event listener for window resizing. It hides or shows grid columns based on the client width. ```javascript var baseUrl = '/'; function InitializeWindowSizeSettings() { if (document.documentElement.clientWidth < 480) { HideGridColumns(); } else { ShowGridColumns(); } } var count = 0; $(document).ready(function () { InitializeWindowSizeSettings(); window.onresize = (function () { InitializeWindowSizeSettings(); InitializeWindowSettings(); }); }); ``` -------------------------------- ### Starting the Agent Manually Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/mass_example.html Manually starts the agent. This is typically handled automatically on script load. ```javascript e.start = () => { try { (0, i.p)(u.xV, ["API/start/called"], void 0, n.K7.metrics, e.ee), e.ee.emit("manual-start-all") } catch (e) { (0, c.R)(23, e) } } ``` -------------------------------- ### Start Polling for Data Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/docket_history_reports/ksd_8097.html Starts polling for data using the request manager. It stores poll data and callbacks. ```javascript s.prototype.startPolling = function(t, e, r, n) { this.polls[e] = { data: t, id: e, callback: r, uninstall: n }; this.timeout || this.poll(); }; ``` -------------------------------- ### Sign In with Email and Password Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/lasc/authentication_samples/sign_in_with_existing_account.html This snippet shows how to initiate a sign-in flow using an email address and password. Ensure you have the necessary authentication library imported. ```javascript function signInWithEmailAndPassword(email, password) { return auth.signInWithEmailAndPassword(email, password); } ``` -------------------------------- ### Example PACER Transaction Receipt Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/confirmation_pages/ca11_1.html An example of a transaction receipt from the PACER Service Center, detailing a document download. ```text PACER Service Center Transaction Receipt 09/15/2022 18:10:29 PACER Login: -------- Client Code:   Description: PDF Document Search Criteria: Case: 10-14375, Document: 01116407625 Billable Pages: 27 Cost: 2.70 * * * Show PDF Header ``` -------------------------------- ### Set up prototypal inheritance (ES5) Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/attachment_pages/nysb_269295.html Establishes prototypal inheritance for constructor functions, compatible with ES5 environments. ```javascript e.exports = function (t, e) { t.super_ = e, t.prototype = Object.create(e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }) } ``` -------------------------------- ### Build GET Request Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/docket_history_reports/ksd_8097.html Builds a synchronous GET request function. It formats the output using a provided formatter. ```javascript i.prototype.buildGet = function() { var t = this; return function() { return t.formatOutput(t.requestManager.send({ method: t.getter })); }; }; ``` -------------------------------- ### Initializing Agent with Configuration Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/mass_example.html Initializes the agent with provided configuration, including init settings, info, loader config, and runtime details. ```javascript function j(e, t = {}, r, n) { let { init: i, info: o, loader_config: a, runtime: c = {}, exposed: u = !0 } = t; c.loaderType = r; const l = (0, d.pV)(); o || (i = l.init, o = l.info, a = l.loader_config), (0, S.xN)(e.agentIdentifier, i || {}), (0, I.a)(e.agentIdentifier, a || {}), o.jsAtt ``` -------------------------------- ### Reset and Restore Installation ID Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/dockets/not_dockets/wawb_646603.html Resets all data and then restores the installation ID if it was previously captured. Useful for re-initializing after a reset. ```javascript a.Sn = function() { var b; return e("installationDetailId").then(function(a) { b = a; }).then(function() { return new Promise(function(b) { a.reset(b); }); }).then(function() { if (b) { return f("installationDetailId", b); } }); }; ``` -------------------------------- ### Install uv package manager Source: https://github.com/freelawproject/juriscraper/blob/main/CONTRIBUTING.md Installs the 'uv' package manager using a script. This is a prerequisite for setting up the development environment. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Buffer Creation and Basic Properties Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/attachment_pages/nysb_269295.html Demonstrates how to create a buffer and check if an object is a buffer instance. ```javascript s.isBuffer = function (t) { return null != t && !0 === t._isBuffer } ``` -------------------------------- ### Set up prototypal inheritance (pre-ES5) Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/attachment_pages/nysb_269295.html Establishes prototypal inheritance for constructor functions in environments that do not support Object.create. ```javascript e.exports = function (t, e) { t.super_ = e; var r = function () { }; r.prototype = e.prototype, t.prototype = new r, t.prototype.constructor = t } ``` -------------------------------- ### Set Navigation Start Time Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/texag_example.html Sets the navigation start time. This is typically used to record the beginning of a navigation event. ```javascript function s(e){o=e} ``` -------------------------------- ### Initialize Environment Configuration Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/dockets/not_dockets/wawb_646603.html Initializes the environment configuration, including user details, account information, and versioning. It sets up various URL endpoints and identifies the primary domain. ```javascript function p() { } function t() { a.ENV.user && g(); a.ENV.account && m(); w(); a.ENV.cmeMajorVersion = a.ENV.version.split(".")[0]; a.ENV.agentURL = a.ENV.httpsBaseURL + "/agent"; a.ENV.savePageURL = a.ENV.agentURL + "/SavePage"; a.ENV.resolvePageURL = a.ENV.agentURL + "/ResolvePage"; a.ENV.listAppURL = a.ENV.agentURL + "/listApplications"; var b = a.ENV.httpsBaseURL.substring(8), b = 0 < b.indexOf(":") ? b.substring(0, b.indexOf(":")) : b; a.ENV.Lm = 0 < b.indexOf("/") ? b.substring(0, b.indexOf("/")) : b; a.ENV.manageRoot = a.ENV.httpsBaseURL + "/3"; a.ENV.On = [a.ENV.httpsBaseURL]; } function w() { a.ENV.securityOfficer = null; a.ENV.securityOfficers && (a.ENV.securityOfficers.length ? (a.ENV.securityOfficer = a.ENV.securityOfficers[0], a.ENV.securityOfficers.forEach(function(a) { D[a.email] = a; })) : a.ENV.securityOfficers = null); } function g() { a.ENV.userId = a.ENV.user.id; a.ENV.email = a.ENV.user.email; var b = null; a.ENV.user.firstName && (b = a.ENV.user.firstName); a.ENV.user.last ``` -------------------------------- ### Object.setPrototypeOf Example Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/attachment_pages/nysb_269295.html Sets the prototype of an object. This example demonstrates setting a new prototype for an object, which can affect property lookups. ```javascript var proto = { greet: 'Hello' }; var obj = Object.create(null); Object.setPrototypeOf(obj, proto); console.log(obj.greet); // Output: 'Hello' ``` -------------------------------- ### Initialize Agent Configuration Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/opinions/united_states/texag_example.html Sets up core agent configurations including beacon endpoints, global scope, and initializes agent info and settings. ```javascript 4580:(e,t,r)=>{"use strict";r.d(t,{EZ:()=>u,Qy:()=>s,ce:()=>o,fP:()=>a,gG:()=>d,mF:()=>c});var n=r(9206),i=r(8438);const o={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net"};function a(){return i.ZP?.NREUM||(i.ZP.NREUM={}),void 0===i.ZP?.newrelic&&(i.ZP.newrelic=i.ZP.NREUM),i.ZP.NREUM}function c(){let e=a();if(!e.o){var t=self,r=t.XMLHttpRequest;e.o={ST:setTimeout,SI:t.setImmediate,CT:clearTimeout,XHR:r,REQ:t.Request,EV:t.Event,PR:t.Promise,MO:t.MutationObserver,FETCH:t.fetch}}return e}function s(e,t,r){let i=a();const o=i.initializedAgents||{},c=o[e]||{};Object.keys(c).length||(c.initializedAt={ms:(0,n.zO)(),date:new Date}),i.initializedAgents={...o,[e]:{...c,[r]:t}},i}function u(e,t){a()[e]=t}function d(){return function(){let e=a();const t=e.info||{};e.info={beacon:o.beacon,errorBeacon:o.errorBeacon,...t}}(),function(){let e=a();const t=e.init||{};e.init={...t}}(),c(),function(){let e=a();const t=e.loader_config||{};e.loader_config={...t}}(),a()}} ``` -------------------------------- ### Build Asynchronous GET Request Source: https://github.com/freelawproject/juriscraper/blob/main/tests/examples/pacer/docket_history_reports/ksd_8097.html Builds an asynchronous GET request function. It handles the response asynchronously and formats the output. ```javascript i.prototype.buildAsyncGet = function() { var t = this, e = function(e) { t.requestManager.sendAsync({ method: t.getter }, function(r, n) { e(r, t.formatOutput(n)); }); }; return e.request = this.request.bind(this), e; }; ```