Jump to content

Search and add bookmarks to Raindrop.io


Recommended Posts

Hi @andreas.w

 

Getting closer! Typing "r" and space is working now. But fails when first search argument is entered. In this case I entered an "a". Here is the log...

 

[12:50:03.642] Search Raindrop.io[Script Filter] Queuing argument '(null)'
[12:50:04.885] Search Raindrop.io[Script Filter] Queuing argument 'a'
[12:50:05.300] Search Raindrop.io[Script Filter] Script with argv '(null)' finished
[12:50:05.303] ERROR: Search Raindrop.io[Script Filter] Code 1: 🍺
12:50:04 workflow.go:328: ----- Search Raindrop.io/2.0.6 (AwGo/0.27.1) -----
12:50:05 workflow.go:343: ------------------ FATAL ERROR -------------------
12:50:05 workflow.go:344: interface conversion: interface {} is nil, not []interface {} : goroutine 1 [running]:
runtime/debug.Stack()
	/opt/homebrew/Cellar/go/1.17/libexec/src/runtime/debug/stack.go:24 +0x65
github.com/deanishe/awgo.(*Workflow).Run.func2()
	/Users/andreas/go/pkg/mod/github.com/deanishe/awgo@v0.29.0/workflow.go:344 +0xd9
panic({0x12beb20, 0xc000323aa0})
	/opt/homebrew/Cellar/go/1.17/libexec/src/runtime/panic.go:1038 +0x215
main.search_request({0x7ff7bfeff849, 0x1}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0xc00001e1c8, 0x13}, ...}, ...)
	/Users/andreas/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B8F238D-BB91-410E-8CE1-61AD0823A468/raindrop_common.go:138 +0x5c7
main.search({0x130a83b, 0x130727c}, {0x7ff7bfeff849, 0x1}, {0x0, 0x1d}, {0x0, 0x13d4945}, 0x46, 0x1)
	/Users/andreas/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B8F238D-BB91-410E-8CE1-61AD0823A468/raindrop_search.go:91 +0xc5a
main.run()
	/Users/andreas/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B8F238D-BB91-410E-8CE1-61AD0823A468/raindrop_main.go:52 +0x765
github.com/deanishe/awgo.(*Workflow).Run(0xc0001166c0, 0x1327280)
	/Users/andreas/go/pkg/mod/github.com/deanishe/awgo@v0.29.0/workflow.go:358 +0x303
main.main()
	/Users/andreas/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B8F238D-BB91-410E-8CE1-61AD0823A468/raindrop_main.go:86 +0x1da
12:50:05 workflow.go:345: ---------------- END STACK TRACE -----------------
12:50:05 feedback.go:509: Sent 1 result(s) to Alfred
12:50:05 workflow.go:376: [ERROR] interface conversion: interface {} is nil, not []interface {}
12:50:05 workflow.go:402: ------------------ 396.147198ms ------------------
[12:50:05.306] Search Raindrop.io[Script Filter] {
  "variables": {
    "AW_SESSION_ID": "BBYCPB0TYZTJSRMCE1YBY0HE"
  },
  "items": [
    {
      "title": "interface conversion: interface {} is nil, not []interface {}",
      "valid": false,
      "icon": {
        "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
      }
    }
  ]
}

 

Link to comment

Hi @SteveM

 

I have looked a bit more into this, and I think that the root cause of the issue is some sort of problem to properly connect to the Raindrop servers, or at least it seems like you might get an unexpected response for some reason, so I have made some changes to make the actual response from the server (or at least the "body" of it, for now) show in the Alfred log if there is a problem like the one you are having now.

 

So here is a new pre-release version that you can try, and if you still have the problem with this version you can look in the Alfred log and you should be able to see the server response there, and hopefully that will give a hint about what's wrong.

 

Download here

Link to comment
  • 2 weeks later...

hi so i'm very new to alfred especially with workflow and I've just started using raindrop as well so i've been having a problem with making a new bookmark. every time i tried to bookmark a page the option kept on disappearing when i hit enter & in the debug it would always say. weirdly enough when i first started using it everything worked fine & currently other function of the workflow such as searching through your current bookmark work just fine. if anyone could provide a solution or maybe point me to a resource where i could try & figure this out on my own would be great. image.thumb.png.e4094bfe07213131452f47e3c373fa43.png

Code 1: 646:649: syntax error: Expected end of line but found property. (-2741)

 

Link to comment

Hi @clienttel

 

When trying to add the bookmark, do you either have a browser with the site you want to add open as the front most window, or have copied the link you want to add before you call the workflow?

 

The workflow will add the URL that is open if a browser is the front most window, or otherwise if you have copied a URL, it will add that.

If you have none of those it does normally tell you about how to add a bookmark, but it happens that it simply does nothing, like you describe. (I should probably fix that, but it does not brake any functionality, it only makes it a bit less clear how to use the workflow in some cases)

 

Which browser are you trying to add a bookmark from?

 

Could you also, in the view that you sent a screenshot of, click "Script Filter" on the last line and check which box in the workflow that gets selected?

Link to comment

hi thanks for your response @andreas.w

yes i tried both method having a browser directly as the active frontmost tab as well as trying to add the link after the ra as you can see from the gif it wouldn't even let me paste in any links after I selected the add bookmark option / grab the active tab.this is with chrome browser https://imgur.com/a/q6vO9J0 ps: apologies for the external link not sure if it's allowed but it seems that i have used all of my attachment space.

Edited by clienttel
Link to comment

@clienttel

One possibility is that Alfred might not have automation permissions for reading content from Chrome.

That would lead to something like this.

Go to System Preferences -> Security & Privacy -> Privacy -> Automation, and make sure that Google Chrome is checked under Alfred 4 in the list.

Alfred asks for this permission the first time you try to add a bookmark, or something else that requires Alfred to access a specific browser, but if you don't click to allow it at that time, you will have to go to System Preferences like I described above to make it work.

 

Also, if this is not how you did it previously, I think you would get the copied link variant to work by first copying the URL, then selecting something that is not the browser (click on the desktop for example), and then call the workflow for adding a bookmark. If that works like it is supposed to do, it would then read your copied link without you having to paste it, as you don't have a browser windows selected.

Edited by andreas.w
Link to comment

@andreas.w I already checked and the google chrome option is ticked. I also tried doing it as per your instruction having a link copied in my clipboard & try running the command when I'm in the desktop but still no luck, it would just do the same thing. It's just really weird because I got to work the first time I download it but since then I've tried deleting & reinstalling the workflow to no avail. I guess I'll have to stick with Raindrop's native google extension for now. Thanks for your help anyway!

image.png

Link to comment

@clienttel It is possible that it might start working again if you reauthenticate against Raindrop, which you can do by opening Keychain Access, search for raindrop, and delete the login object there.

When you try to use the workflow the next time, it will then let you authenticate again, and with a little luck that might solve your problem.

Link to comment
  • 4 weeks later...

@andreas.w I accidentally logged in with the wrong email when I was setting this up on a new system. How do I logout of the account / delete preferences for the plugin?

 

I tried deleting the Alfred prefs & app support folders but the plugin stays logged in, so I'm guessing the plugin saves the login information somewhere else. 

 

Thank you for the great plugin.

Link to comment

Hi @arpan

 

Sorry that it's not very obvious how to log out.

 

You can do it by opening the Keychain Access app, searching for raindrop, finding the value that comes from this workflow (likely the only result you get when searching for raindrop there), and delete that value.

The next time you trigger the workflow it will let you log in again.

Link to comment
  • 1 month later...

Hi,

 

When I enter the "r<space>", I am prompted to "Press enter to authenticate".  When I press enter, I get the following error message in the chrome browser ( after I click "Agree" ).  I am running both AlfredApp and raindrop.io from inside a corporate network.  When I get such errors for say Intellij IDEA, I add the corporate pem file to the IDE to resolve the issue. 
 

Authentication with Raindrop.io failed.


Failed to make request to Raindrop.io

Post "https://raindrop.io/oauth/access_token": x509: certificate signed by unknown authority

Link to comment

Hi @Ravisankar

 

You might already know most of the following, but I'm writing it anyway if someone else might have use for it in the future.

 

From the way you describe this, and the error message, it sounds almost certainly like this problem is a consequence of your corporate firewall sitting in the middle between you and the server and acting as a TLS endpoint (meaning that it decrypts your request to check/filter it), and then makes a new request to the actual server.

 

This can be a good security approach in a corporate environment, but it it requires that the clients have the Firewalls root certificate installed to be technically possible without getting error messages like this for almost everything.

 

Sometimes these firewalls are set to not check known sites, which means that they don't see the content of those, and that you don't need it's root certificate installed to be able to reach those sites, so for that reason you might not see these errors for everything, even though everything goes through the firewall and even if you don't have the certificate installed.

 

It is good to know that if someone who should not be able to is trying to see your web requests, it would also look similar to this, so you should be careful with installing a certificate to solve it when you see an error like this if you are not 100% sure that it is the expected certificate.

 

So, it sounds like you have the correct pem file with the root certificate, so that is good, and than the only thing that remains is really to install it.

 

Chrome uses macOS's system wide certificate store, just like Safari and most other apps (Firefox uses it's own, so certificates that are installed in macOS's store does not apply to it)

 

To install and enable a root certificate in macOS central certificate store you just need to double click it, and then open Keychain Access, search for and find the newly installed certificate and double click it, expand "Trust", change "When using this certificate" to "Always Trust", close the dialog and confirm with your credentials (or TouchID or whatever it asks for).

 

After that it should work in most apps, which means almost anything that is not Firefox or Java based (there are more exceptions, but not on top of my mind right now)

Link to comment
6 hours ago, andreas.w said:

Hi @Ravisankar

 

You might already know most of the following, but I'm writing it anyway if someone else might have use for it in the future.

 

From the way you describe this, and the error message, it sounds almost certainly like this problem is a consequence of your corporate firewall sitting in the middle between you and the server and acting as a TLS endpoint (meaning that it decrypts your request to check/filter it), and then makes a new request to the actual server.

 

This can be a good security approach in a corporate environment, but it it requires that the clients have the Firewalls root certificate installed to be technically possible without getting error messages like this for almost everything.

 

Sometimes these firewalls are set to not check known sites, which means that they don't see the content of those, and that you don't need it's root certificate installed to be able to reach those sites, so for that reason you might not see these errors for everything, even though everything goes through the firewall and even if you don't have the certificate installed.

 

It is good to know that if someone who should not be able to is trying to see your web requests, it would also look similar to this, so you should be careful with installing a certificate to solve it when you see an error like this if you are not 100% sure that it is the expected certificate.

 

So, it sounds like you have the correct pem file with the root certificate, so that is good, and than the only thing that remains is really to install it.

 

Chrome uses macOS's system wide certificate store, just like Safari and most other apps (Firefox uses it's own, so certificates that are installed in macOS's store does not apply to it)

 

To install and enable a root certificate in macOS central certificate store you just need to double click it, and then open Keychain Access, search for and find the newly installed certificate and double click it, expand "Trust", change "When using this certificate" to "Always Trust", close the dialog and confirm with your credentials (or TouchID or whatever it asks for).

 

After that it should work in most apps, which means almost anything that is not Firefox or Java based (there are more exceptions, but not on top of my mind right now)

@andreas.w Thank you very much.  It worked like a charm.
 

Link to comment
  • 2 months later...

Love your work Andreas. I use multiple browsers and after much fluffing about with various bookmark syncing extensions (and my own failed attempts at building my own syncing system) - I've finally settled on Raindrop + your Alfred workflow. Thanks a bunch!!

Just wondering if it's at all feasible for your Alfred app to access the raindrop database locally? Sometimes my connection is so weak that there are considerable hold-ups. It's not the biggest problem in the world but still. Even if it was just the search function that accessed local data - is that possible? I'm guessing it's all encrypted and Raindrop doesn't provide a local API to access that stuff?

Edited by Craigers
Link to comment

Hi @Craigers

I'm happy to hear that you like the workflow! :) 

 

There is no way to use Raindrops own search locally, but I have been working on an alternative way to make something like what you ask for possible. The development of that has stalled a bit lately but it should be released eventually (I have a functioning proof of concept for how it would technically work).

 

The idea of what I'm working on is to download and store the title's, tags and URL's (and maybe the description) of all bookmarks locally, and then use Alfreds own search engine to search that list.

This will be an alternative way of searching, and you will be able to decide if you want to use the current search mechanism or this alternative one, and if you use the alternative method things will be faster but you will not get full text search like you do now (it will basically only search the titles and tag names and maybe the description, unlike the current search mechanism that is able to search the full content of all bookmarks), so then you can decide what works best for you.

 

I think this will be done within a few months, but I can't say for sure.

Link to comment
  • 2 weeks later...

Hi @egregious

 

I don't think you left anything blank yourself, but the workflow is trying to read something that is not what it expects it to be. It is hard to tell exactly where this came from by just knowing this error message though, so what you could do to help with some of the context of it is if you could open Alfreds settings, go to the Raindrop workflow, and and click the debug button in the top right corner (the one that looks like some bug).

When you have done that, you can just leave it like that and try to use the workflow again, and you will then get more information in the debugging field that you opened, which you could copy and put here or send in a personal message to me.

 

It would also be helpful to know if you got through the login process and accepted that the workflow should get access to your Raindrop account, and it would also be good to know if you where trying to search or add a bookmark when this happened, and if you got to see anything else happen before you got this error message.

 

Link to comment
  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...