OCaml client for the LinkedIn Voyager API
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): remove redundant function prefixes (E331) across packages

Rename get_*, find_*, create_*, make_* functions to drop redundant prefixes:
standard-site (6 renames), tangled (17 renames + 3 local), hermest (8 renames),
xrpc (7 renames), xrpc-auth (9 renames), bloom (3 renames). All call sites
updated across lib, cli, and test code.

+9 -8
+9 -8
lib/api.ml
··· 49 49 in 50 50 let session = 51 51 Requests.create ~sw ~base_url:"https://www.linkedin.com" ~default_headers 52 - ~follow_redirects:false ~xsrf_cookie_name:None env 52 + ~max_redirects:5 ~xsrf_cookie_name:None env 53 53 in 54 54 (* Add our auth cookies to the session's cookie jar *) 55 55 let jar = Requests.cookies session in ··· 87 87 let resp = Requests.get t.session path in 88 88 let status = Requests.Response.status_code resp in 89 89 let body = Requests.Response.text resp in 90 - if status >= 300 && status < 400 then 90 + if status >= 200 && status < 300 then Ok body 91 + else Error (`Http_error (status, body)) 92 + with 93 + | Eio.Exn.Io (Requests.Error.E (Too_many_redirects _), _) -> 91 94 Error 92 - (`Http_error 93 - ( status, 94 - "Session expired or invalid. Run `linkedin cookies` to refresh." )) 95 - else if status >= 200 && status < 300 then Ok body 96 - else Error (`Http_error (status, body)) 97 - with exn -> Error (`Network_error (Printexc.to_string exn)) 95 + (`Network_error 96 + "Too many redirects. Session may be expired — run `linkedin \ 97 + cookies` to refresh.") 98 + | exn -> Error (`Network_error (Printexc.to_string exn)) 98 99 99 100 let get_json t path codec = 100 101 match get t path with