Search Legal Intelligence directly from your Alfred App. It will display the 10 most relevant results. Clicking a result will open the Legal Intelligence link to the document. If your desired result isn't there, at the bottom there is also a 'view all results', which directs you to your search query on Legal Intelligence. You need not be logged into Legal Intelligence, however you do need a token, which expires every day. I am working on a way to generate this every day.
Installation
Download the workflow from GitHub or Packal
You require a Legal Intelligence account, client-secret, and authorisation token.
It also requires an Alfred Powerpack license.
Getting a client-secret
Log into your Legal Intelligence account. Then simply click this link and generate a client secret. Copy this somewhere as you'll need it for your authorisation token, and it is not displayed in your account.
Insert your client-secret and client-ID in workflow
Open the imported workflow in Alfred. Open the Environmental Variables (Thanks to @vitor for the suggestion!) and insert your ClientID (for me it was my university email address) and your ClientSecret that you generated earlier.
Save and that ought to do it!
Dependencies
The workflow requires the Python requests module and xml2dict which are bundled in the released workflow so no need to install it separately.
NEW FEATURES in v.1.3.1 :
type 'wet [query]' it searches the database of wetten.overheid.nl for any law that matches the title. You can also use abbreviations such as 'bw1' or 'aw' for Burgerlijk Wetboek Boek 1 and Auteurswet respectively. You will be redirected to the specific law and today as validation date.
type 'hr' without any other text and you should get the latest 7 days worth of Hoge Raad cases.
type 'phr' without any other text and you should get the latest 7 days worth of AG Opinions.
BUG FIXES:
There was a bug where if the result had " (double quotes) in it, Alfred would end the workflow. This is now fixed. Same with new line. This is also escaped now.
# TODO
Fix bug that less than 10 results won't be displayed. (has to do with the use of count function)
Include a delay, so that api is not called for each letter that is typed
Find a way that login is not required in browser for it to work
Find a way to automatically generate authorisation token
Insert a link to all the search results in Legal Intelligence itself
Searching latest issue of a journal now requires the correct use of capitals for the abbreviation. I want to make it irrelevant whether the user types in the correct capitalisation in the abbreviation.