flymingo Posted November 3, 2022 Share Posted November 3, 2022 38 minutes ago, wrjlewis said: Can you copy everything after Cookie: in your screenshot, and use that as your cookie value to paste into the workflow environment variable i have copied cookies and notionspaceid to environment,run the workflow will turn to notion homepage ,when i search it shows Link to comment
wrjlewis Posted November 3, 2022 Author Share Posted November 3, 2022 2 minutes ago, flymingo said: i have copied cookies and notionspaceid to environment,run the workflow will turn to notion homepage ,when i search it shows Try this:https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate/58525755#58525755 Link to comment
wrjlewis Posted November 3, 2022 Author Share Posted November 3, 2022 13 minutes ago, vitor said: Not without information. Open the debugger, set the log output to “All Information”, perform the failing action, and post the output. It’s been out of beta since October 24th. Since Oct 24th! I didn't get the update notification, so maybe my old iMac is finally out of support.. Link to comment
flymingo Posted November 3, 2022 Share Posted November 3, 2022 12 minutes ago, wrjlewis said: Try this:https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate/58525755#58525755 thank you very much !!! it works For anyone who still wonders on how to fix this, i got mine by installing the "Install Certificates.command" ( /Applications/Python\ 3.10/Install\ Certificates.command) wrjlewis 1 Link to comment
blastik Posted November 30, 2022 Share Posted November 30, 2022 (edited) hello im getting the same behaviour as other people after upgrading to your v0.5.1. No traces of the certificate problem. I'm on a M1 which `Python 3.10.4` installed by asdf and set to the system global Edited November 30, 2022 by blastik Link to comment
wrjlewis Posted November 30, 2022 Author Share Posted November 30, 2022 7 minutes ago, blastik said: hello im getting the same behaviour as other people after upgrading to your v0.5.1. No traces of the certificate problem. I'm on a M1 which `Python 3.10.4` installed by asdf and set to the system global Hi was everything working on 0.5 or prior versions? does any error appear in the search results itself in Alfred? When you type ns something thanks Link to comment
blastik Posted December 1, 2022 Share Posted December 1, 2022 (edited) 23 hours ago, wrjlewis said: Hi was everything working on 0.5 or prior versions? does any error appear in the search results itself in Alfred? When you type ns something thanks yes it was working fine prior to 0.5 when i query notion on the web browser works fine no other errors are shown in alfred note that the python is installed via asdf and configured as global which python /Users/username/.asdf/shims/python Edited December 1, 2022 by blastik Link to comment
wrjlewis Posted December 1, 2022 Author Share Posted December 1, 2022 1 hour ago, blastik said: yes it was working fine prior to 0.5 when i query notion on the web browser works fine no other errors are shown in alfred note that the python is installed via asdf and configured as global which python /Users/username/.asdf/shims/python Looks like nothing is being returned at all. Can you please try obtaining your cookie and space id again, and adding them to the workflow, if you haven't already? Sometimes Notion changes the token on their side and it needs updating in the workflow. Link to comment
wrjlewis Posted December 1, 2022 Author Share Posted December 1, 2022 If that doesn't work, I would be interested if installing the older version again, works for you. Link to comment
blastik Posted December 13, 2022 Share Posted December 13, 2022 installed back the latest v4 version and works without issues Link to comment
wrjlewis Posted December 13, 2022 Author Share Posted December 13, 2022 13 minutes ago, blastik said: installed back the latest v4 version and works without issues Strange. There’s no difference in that part of the code 🤷♂️ Link to comment
billyadams Posted December 21, 2022 Share Posted December 21, 2022 How might you modify the script if you wanted it to return a specific property from the page you select? My use case is that I have a database of old account codes for our company with corresponding new account codes (3,000+) and I wanted to be able to search from Alfred with the old code and have it return the new one. Is this even possible? Link to comment
wrjlewis Posted December 22, 2022 Author Share Posted December 22, 2022 (edited) 16 hours ago, billyadams said: How might you modify the script if you wanted it to return a specific property from the page you select? My use case is that I have a database of old account codes for our company with corresponding new account codes (3,000+) and I wanted to be able to search from Alfred with the old code and have it return the new one. Is this even possible? Hey It is possible to do, but its way beyond the scope of making a few modifications to this script. This workflow searches pages, it doesn't get the contents of pages (or databases) and do things with it. You would need a new workflow, new code, and different calls to Notion. After a quick look, you'd want to make a call to https://www.notion.so/api/v3/queryCollection? with the appropriate query parameters, the database contents will be within the response in recordMap - block - value - properties.. There you'd need to apply some logic to figure out which is the corresponding account code. Quite a lot of work to do, and for quite a custom use case. Edited December 22, 2022 by wrjlewis billyadams 1 Link to comment
fskdjfn Posted December 31, 2022 Share Posted December 31, 2022 (edited) On 9/20/2022 at 1:14 AM, wrjlewis said: Welcome! It seems to be working as far I can tell. Have you got the latest version? I had the same issue as nd0 with the latest version of the workflow. I debug it and found it's because there's a curly brace in my Notion cookie, but SimpleCookie stops parsing at the curly brace, which will lead to no notion_user_id in bakedCookie. Since your code only needs notion_user_id, I extract it with regex and it works for me now. I can pr the code if that's helpful. Thanks for this amazing workflow! Edited December 31, 2022 by fskdjfn Link to comment
wrjlewis Posted January 2 Author Share Posted January 2 On 12/31/2022 at 5:01 AM, fskdjfn said: I had the same issue as nd0 with the latest version of the workflow. I debug it and found it's because there's a curly brace in my Notion cookie, but SimpleCookie stops parsing at the curly brace, which will lead to no notion_user_id in bakedCookie. Since your code only needs notion_user_id, I extract it with regex and it works for me now. I can pr the code if that's helpful. Thanks for this amazing workflow! Hey, thanks for posting your update, its incredibly helpful and allows me to improve the workflow further. So were you getting the latin-1 codec error? Interestingly I have curly braces in my cookie, so that seems standard, but I do not get an error. Any thoughts on why that might be? Link to comment
fskdjfn Posted January 3 Share Posted January 3 (edited) 10 hours ago, wrjlewis said: Hey, thanks for posting your update, its incredibly helpful and allows me to improve the workflow further. So were you getting the latin-1 codec error? Interestingly I have curly braces in my cookie, so that seems standard, but I do not get an error. Any thoughts on why that might be? My guess is the Python version. I have Python 3.9 installed. And you can see SimpleCookie stops at curly braces as well from this online IDE: https://tech.io/snippet/kh1JGkc and the Python version here is 3.11.1 Edited January 3 by fskdjfn Link to comment
wrjlewis Posted January 3 Author Share Posted January 3 11 hours ago, fskdjfn said: My guess is the Python version. I have Python 3.9 installed. And you can see SimpleCookie stops at curly braces as well from this online IDE: https://tech.io/snippet/kh1JGkc and the Python version here is 3.11.1 I'm using 3.9.13, by the way. I experience the same SimpleCookie silent parsing fail but the braces in my cookie are after all the information I need, I'm not sure what dictates the cookie key/value ordering but seems folk like me are currently getting lucky. I did a bit of digging and thanks for your code snippet, it is the perfect example because it seems other have pointed out the same issue in Python due to google's oauth cookie implementation, which demonstrates the issue well. Example isse: https://github.com/python/cpython/issues/92936 It looks like a fix has been merged but obviously won't be available in all but the latest version of Python (if thats been released since the merge, I'm not sure). Could you please post the patch, or PR, with the fix you made? At least we can fix it locally for now. Thanks. Link to comment
fskdjfn Posted January 4 Share Posted January 4 14 hours ago, wrjlewis said: I'm using 3.9.13, by the way. I experience the same SimpleCookie silent parsing fail but the braces in my cookie are after all the information I need, I'm not sure what dictates the cookie key/value ordering but seems folk like me are currently getting lucky. I did a bit of digging and thanks for your code snippet, it is the perfect example because it seems other have pointed out the same issue in Python due to google's oauth cookie implementation, which demonstrates the issue well. Example isse: https://github.com/python/cpython/issues/92936 It looks like a fix has been merged but obviously won't be available in all but the latest version of Python (if thats been released since the merge, I'm not sure). Could you please post the patch, or PR, with the fix you made? At least we can fix it locally for now. Thanks. Thanks for sharing the digging! I tried PR but got denied from GitHub. So here's the notion.py I updated: https://tech.io/snippet/0TmWuss. wrjlewis 1 Link to comment
wrjlewis Posted January 4 Author Share Posted January 4 7 hours ago, fskdjfn said: Thanks for sharing the digging! I tried PR but got denied from GitHub. So here's the notion.py I updated: https://tech.io/snippet/0TmWuss. Thanks! I've added an issue for it: https://github.com/wrjlewis/notion-search-alfred5-workflow/issues/5 I'll fix this in the next release 👍 fskdjfn 1 Link to comment
eupraxia Posted February 5 Share Posted February 5 @wrjlewis this workflow is fantastic! Much more sophisticated than my puny little workflow hehe. Question: with your workflow, is it possible to have pages open in a new window? I've gotten your workflow to work, but it seems to only be able to open pages in the existing window, which isn't as useful since I can already do that with Cmd + K. Am I using it wrong? Is there functionality that has evaded me? If not, how difficult would it be to modify your workflow to open the pages in a new window rather than an already open window? Really really awesome job. Thank you so much man! Tommy Link to comment
wrjlewis Posted February 6 Author Share Posted February 6 On 2/5/2023 at 10:45 AM, eupraxia said: @wrjlewis this workflow is fantastic! Much more sophisticated than my puny little workflow hehe. Question: with your workflow, is it possible to have pages open in a new window? I've gotten your workflow to work, but it seems to only be able to open pages in the existing window, which isn't as useful since I can already do that with Cmd + K. Am I using it wrong? Is there functionality that has evaded me? If not, how difficult would it be to modify your workflow to open the pages in a new window rather than an already open window? Really really awesome job. Thank you so much man! Tommy Hey Glad you're enjoying the workflow. So the workflow operates by sending the URL to Alfreds Open URL action. This will be notion:// (if you're using the desktop app) + the object id of the page. I'm not sure if there is anything thet can be added to this URL in order to ensure that the page is opened in a new tab when using the desktop app, would be happy to make a change if someone knows. When using the web app, it always opens in a new tab. Link to comment
dterranova Posted February 22 Share Posted February 22 Hi, excited to try this out! I'm getting the same behaviour as others: "No results, empty query, or error" I've gone through the last few pages in this thread but not 100% sure where my issue lies. I'll recap my steps: - installed the workflow. - pasted the cookie vars notion_browser_id into Cookie , token_v2 into Space ID. (I think this is what your instructions are pointing to, but sometimes the language used sounds like you're saying to copy the entire chunk of text that comes after "cookie: " which for me is several lines with multiple vars and ; delineators) - Alfred gave errors ("No results, empty query, or error") so I installed python via homebrew. - Alfred error still persisted - Back in Terminal, despite having just installed python, it tells me WARNING: You are using pip version 21.2.4; however, version 23.0.1 is available. You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command. So I ran that command and it gives me this WARNING: The scripts pip, pip3 and pip3.9 are installed in '/Users/***/Library/Python/3.9/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. I don't know if that's even the issue. I checked out the StackOverflow post you linked, but I'm not sure what to do because I don't have Python in my Apps folder. On 11/3/2022 at 9:04 AM, wrjlewis said: Try this:https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate/58525755#58525755 Maybe I wasn't supposed to install python via homebrew? Or is it a case of adding the Python scripts into PATH? (I don't know what that even is) Or something else altogether? Sorry, not super familiar with all this stuff but I'm a longtime tinkerer, so can only get so far. Thanks in advance DT Link to comment
wrjlewis Posted February 22 Author Share Posted February 22 Hi! Quote sounds like you're saying to copy the entire chunk of text that comes after "cookie: " which for me is several lines with multiple vars and ; delineators Thats correct, you need to paste the whole thing into 'cookie'. You are also pasting the wrong thing into space id, you need to get the 'spaceId', not the browser id. The readme on the github page should give you everything you need to know on where to find this value, the pictures are particularly good. Link to comment
dterranova Posted February 22 Share Posted February 22 11 minutes ago, wrjlewis said: Hi! Thats correct, you need to paste the whole thing into 'cookie'. You are also pasting the wrong thing into space id, you need to get the 'spaceId', not the browser id. The readme on the github page should give you everything you need to know on where to find this value, the pictures are particularly good. Ah gotcha, ok. Yeah I went through that readme a few times. Ok I'll grab the whole chunk. For spaceId, I can't actually find it anywhere in Chrome's headers. I copied the entire page (General, Response Headers, Request Headers), pasted into bbedit... "space" doesn't come up. That's why I assumed it was browserID, since it's the only variable that matches the format. Am I looking in the wrong place? I must be misreading something. Link to comment
dterranova Posted February 22 Share Posted February 22 (edited) I just screengrabbed the contents of Chrome's headers. Redacted private data but made sure to keep all var definitions intact.... I wonder if this is due to Notion's Team functionality that others have mentioned, being that there's is no spaceId anymore? Excuse my ignorance, just spitballing. EDIT: I tried copying notion_user_id into Alfred, just in case. No change. EDIT 2: Found it! My bad. Didn't realize spaceID is under the Payload tab, not Headers. It's there and it just started working! Thanks so much. Just saved myself probably 15min per day with this workflow Edited February 22 by dterranova solved! 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