wrjlewis Posted February 17, 2020 Share Posted February 17, 2020 For those who love Notion.so (really great documentation & more tool), you will know how useful it would be to get instant search results from Notion in Alfred. To that reason I've created a workflow that does exactly that, allowing you to search your Notion.so workspace from Alfred, showing instant results, and the ability to open the browser to your selected page. There are two env variables required (the notion search api isn't documented), these can be obtained by inspecting the network request from a notion search, as documented in github below. Check it out and download here: https://github.com/wrjlewis/notion-search-alfred-workflow/blob/master/README.md hug101, flome, MasterBruce and 5 others 1 7 Link to comment
haakonstorm Posted February 23, 2020 Share Posted February 23, 2020 This workflow is awesome. I'm going to use it hundreds of times every day. I had it on my todo to make it myself, but haven't gotten around to it. Notion is awesome. When the (official) Notion API hits, it's gonna change everything. Link to comment
haakonstorm Posted February 27, 2020 Share Posted February 27, 2020 Hey, would it be much work (I don't know Python!) to add - in addition to searching with `ns` an operator like `nsall` that returns every "title" from ny Notion items? - or searching and returning everything (or just the titles/names!) inside a particular Table? Link to comment
flome Posted April 17, 2020 Share Posted April 17, 2020 Just want to say thanks for making this! I rely on notion so heavily that I have my own python scripts (using notion-py) to manipulate my productivity system. Link to comment
MasterBruce Posted April 18, 2020 Share Posted April 18, 2020 This is beautiful, @wrjlewis You're amazing! In the readme you mention: Quote If you prefer using the Mac app of Notion, just replace https://www.notion.so with notion://www.notion.so/ in the workflow script. Please clarify where, or just provide the full script, for simplicity. It isn't quite working for me. Thanks so much!! Link to comment
johnathanz Posted May 6, 2020 Share Posted May 6, 2020 @wrjlewis Thanks so much for creating this plugin. It's pretty awesome!@MasterBruce to have the plugin work with desktop version of Notion: 1) you click the Script in Alfred workflow 2) in the Script Field, search for the words (there should be 2 instances) http://www.notion.so/ 3) replace the text with: notion://www.notion.so/ Schmedu 1 Link to comment
possertive Posted May 6, 2020 Share Posted May 6, 2020 I'm not getting any results. Is this still working? leo 1 Link to comment
MasterBruce Posted May 6, 2020 Share Posted May 6, 2020 15 hours ago, possertive said: I'm not getting any results. Is this still working? It's working for me. 1. Bring up Alfred 2. Type "ns " and then your search term. 3. After a small delay, the results populate. Link to comment
johnathanz Posted May 7, 2020 Share Posted May 7, 2020 (edited) I made some changes to @wrjlewis Workflow: * Added title search - use "nt" * Works with Notion Desktop instead of Notion web * Cosmetic changes in search results Download the workflow here if interested: https://github.com/johnathanz/notion-search-alfred-workflow Edited May 7, 2020 by johnathanz Chris Messina 1 Link to comment
leo Posted May 8, 2020 Share Posted May 8, 2020 On 5/6/2020 at 7:17 AM, possertive said: I'm not getting any results. Is this still working? Same here! 1. I show up alfred 2. type "ns term" 3. answer always "no results - go to notion homepage" What is wrong? Link to comment
haakonstorm Posted May 8, 2020 Share Posted May 8, 2020 2 hours ago, leo said: 3. answer always "no results - go to notion homepage" What is wrong? Probably your Notion.so authentication token has expired. Create a new token according to documentation and try again. Try turning on debugging in the Alfred workflow and see what that outputs. Link to comment
haakonstorm Posted May 8, 2020 Share Posted May 8, 2020 On 5/7/2020 at 4:17 AM, johnathanz said: I made some changes to @wrjlewis Workflow: (snip) Download the workflow here if interested: https://github.com/johnathanz/notion-search-alfred-workflow Please submit a PR to the original devs repo. Link to comment
wrjlewis Posted May 9, 2020 Author Share Posted May 9, 2020 Really glad people are using this and finding it a good addition to their productivity workflows! If you have any PRs or issues to add to the repo, I'll gladly review. Thanks Link to comment
Yourname Posted May 11, 2020 Share Posted May 11, 2020 Just an FYI to others, this seems to work on Alfred v4+ Link to comment
Yourname Posted May 11, 2020 Share Posted May 11, 2020 Updated, did everything but there's no search happening @wrjlewis Link to comment
wrjlewis Posted May 12, 2020 Author Share Posted May 12, 2020 21 hours ago, Yourname said: Updated, did everything but there's no search happening @wrjlewis Have you copied the cookie and spaceid over to the env variables of the workflow? Can you show me the output of the debug window when you try and search with the debugging view on? https://www.alfredapp.com/help/workflows/advanced/debugger/ Link to comment
Moore Posted May 14, 2020 Share Posted May 14, 2020 (edited) Great workflow! Edited May 14, 2020 by Moore wrjlewis 1 Link to comment
wrjlewis Posted May 14, 2020 Author Share Posted May 14, 2020 Version 0.2 now out. Probably the most useful part is that you can toggle use of the desktop client or the web app. + returns 9 search items from notion to match the number that can be displayed at once in Alfred + refactored into a separate python script to allow for easier diffs and version control. Now using the releases feature in GitHub. + Option to change the 'isNavigableOnly' search filter via the 'isNavigableOnly' env variable. I personally prefer only to search notion objects that can be navigated to, as I have a large workspace which would clutter the results, but the default search in notion has this option as false, so including this as an env variable. + Option to switch support to the notion web app or the notion desktop app using the useDesktopClient env variable. https://github.com/wrjlewis/notion-search-alfred-workflow/releases/latest/download/Notion.Search.alfredworkflow Yourname 1 Link to comment
Yourname Posted May 15, 2020 Share Posted May 15, 2020 On 5/12/2020 at 12:18 PM, wrjlewis said: Have you copied the cookie and spaceid over to the env variables of the workflow? Can you show me the output of the debug window when you try and search with the debugging view on? https://www.alfredapp.com/help/workflows/advanced/debugger/ Yes I did @wrjlewis My cookie starts with __cfduid= but your readme says the cookie starts with notion_browser_id. I tried both ways, also by deleting the __cfduid part so it starts with notion_browser_id and it didn't work. Here's the debug: [07:50:54.665] Notion Search[Script Filter] Queuing argument 'evernote' [07:50:54.886] Notion Search[Script Filter] Script with argv '(null)' finished [07:50:54.897] ERROR: Notion Search[Script Filter] Code 1: Traceback (most recent call last): File "notion.py", line 114, in <module> buildNotionSearchQueryData(alfredQuery), headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request self._send_request(method, url, body, headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request self.endheaders(body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders self._send_output(message_body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 893, in _send_output self.send(msg) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 855, in send self.connect() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1274, in connect server_hostname=server_hostname) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 352, in wrap_socket _context=self) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__ self.do_handshake() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 808, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) Link to comment
wrjlewis Posted May 15, 2020 Author Share Posted May 15, 2020 35 minutes ago, Yourname said: Yes I did @wrjlewis My cookie starts with __cfduid= but your readme says the cookie starts with notion_browser_id. I tried both ways, also by deleting the __cfduid part so it starts with notion_browser_id and it didn't work. Here's the debug: [07:50:54.665] Notion Search[Script Filter] Queuing argument 'evernote' [07:50:54.886] Notion Search[Script Filter] Script with argv '(null)' finished [07:50:54.897] ERROR: Notion Search[Script Filter] Code 1: Traceback (most recent call last): File "notion.py", line 114, in <module> buildNotionSearchQueryData(alfredQuery), headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request self._send_request(method, url, body, headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request self.endheaders(body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders self._send_output(message_body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 893, in _send_output self.send(msg) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 855, in send self.connect() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1274, in connect server_hostname=server_hostname) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 352, in wrap_socket _context=self) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__ self.do_handshake() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 808, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) Looks like an issue with your SSL version. Whats the output of this in your terminal? python -c "import ssl; print(ssl.OPENSSL_VERSION)" Link to comment
Yourname Posted May 15, 2020 Share Posted May 15, 2020 (edited) 1 hour ago, wrjlewis said: python -c "import ssl; print(ssl.OPENSSL_VERSION)" OpenSSL 0.9.8zh 14 Jan 2016 Thanks @wrjlewis that seems super old lol, so running a brew update. Update: brew didn't seem to update it. So I'll wait for your response. Edited May 15, 2020 by Yourname Link to comment
wrjlewis Posted May 15, 2020 Author Share Posted May 15, 2020 It could be a couple of things - but I would suggest trying to update your SSL version first, as you've got a fairly old version. Can you follow the steps in the top answer below?https://apple.stackexchange.com/questions/126830/how-to-upgrade-openssl-in-os-x If you haven't got 'brew' installed, which can be used to upgrade ssl (and loads of other packages), it can be done with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" Link to comment
fxf Posted May 18, 2020 Share Posted May 18, 2020 Hi, What a wonderful workflow! I followed step by step your guide. However, it's not working on my side : no results are displayed :( The debugger shows this : [11:26:15.798] Logging Stopped. [11:26:16.595] Logging Started... [11:26:23.441] Notion Search[Script Filter] Queuing argument 'l' [11:26:23.488] Notion Search[Script Filter] Queuing argument 'le' [11:26:23.550] Notion Search[Script Filter] Queuing argument 'lea' [11:26:23.641] Notion Search[Script Filter] Queuing argument 'lean' [11:26:25.844] Notion Search[Script Filter] Script with argv '(null)' finished [11:26:25.847] Notion Search[Script Filter] {"items": [{"arg": "https://www.notion.so/", "type": "default", "uid": 1, "title": "No results - go to Notion homepage"}]} [11:26:26.620] Notion Search[Script Filter] Script with argv '(null)' finished [11:26:26.623] Notion Search[Script Filter] {"items": [{"arg": "https://www.notion.so/", "type": "default", "uid": 1, "title": "No results - go to Notion homepage"}]} I use Alfred 4.0.9. Any idea where the problem comes from ? Link to comment
Yourname Posted May 19, 2020 Share Posted May 19, 2020 On 5/15/2020 at 10:08 AM, wrjlewis said: It could be a couple of things - but I would suggest trying to update your SSL version first, as you've got a fairly old version. Can you follow the steps in the top answer below?https://apple.stackexchange.com/questions/126830/how-to-upgrade-openssl-in-os-x If you haven't got 'brew' installed, which can be used to upgrade ssl (and loads of other packages), it can be done with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" Thanks @wrjlewis! I upgraded and now it's openssl 1.1.1g 21 apr 2020 And here's the new log of errors; [18:30:47.655] Notion Search[Script Filter] Queuing argument 'task' [18:30:47.867] Notion Search[Script Filter] Script with argv '(null)' finished [18:30:47.872] ERROR: Notion Search[Script Filter] Code 1: Traceback (most recent call last): File "notion.py", line 114, in <module> buildNotionSearchQueryData(alfredQuery), headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request self._send_request(method, url, body, headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request self.endheaders(body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders self._send_output(message_body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 893, in _send_output self.send(msg) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 855, in send self.connect() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1274, in connect server_hostname=server_hostname) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 352, in wrap_socket _context=self) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__ self.do_handshake() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 808, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) Link to comment
Yourname Posted May 19, 2020 Share Posted May 19, 2020 Here are the newly updated versions: MacBook-Pro-5:~ xyz$ openssl version -a OpenSSL 1.1.1g 21 Apr 2020 built on: Tue May 19 22:37:37 2020 UTC platform: darwin64-x86_64-cc options: bn(64,64) rc4(16x,int) des(int) idea(int) blowfish(ptr) compiler: clang -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -D_REENTRANT -DNDEBUG OPENSSLDIR: "/usr/local/etc/openssl@1.1" ENGINESDIR: "/usr/local/Cellar/openssl@1.1/1.1.1g/lib/engines-1.1" Seeding source: os-specific MacBook-Pro-5:~ xyz$ python -c "import ssl; print(ssl.OPENSSL_VERSION)" OpenSSL 1.1.1g 21 Apr 2020 MacBook-Pro-5:~ xyz$ python --version Python 3.7.7 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now