Jump to content

Pin Plus — Interact with your Pinboard bookmarks


Recommended Posts

Usage


Add a new bookmark to your Pinboard account via the pa keyword.


pa.png


gui.png


Search all bookmarks via the pin keyword or only the unread ones with pun. Actioning an unread bookmark can archive or delete it if the option is set in the Workflow’s Configuration.


pin.png

  • ↩: Open URL.
  • ⌘↩: Copy URL.
  • ⌥: View Tags.
  • ⌃: View Description.
  • ⇧↩: Open in Pinboard’s Website.

Configure the Hotkeys as a shortcut to add bookmarks, add the current browser tab as an unread bookmark, or open a random unread bookmark.


Bookmarks are automatically fetched if the local data is old, but an update can be forced with ⌘⌥⌃↩.


⤓ Install on the Alfred Gallery | Source

 

Edited by vitor
Link to comment

When reporting issues, please include your exact installed versions of:

  • The Workflow.
  • Alfred.
  • macOS.

In addition to:

  • The debugger output. Perform the failing action, click “Copy” on the top right and paste it here.
  • Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.

Thank you. Accurate and thorough information is crucial for a proper diagnosis which allows me to help you better.

Link to comment
1 hour ago, deanishe said:

Is something like MacGap or pywebview not up to the job?

 

If I tried those, I don’t remember. I tried a few different solutions, and none were up to it (missing features). I don’t remember exactly which, since this Workflow has existed for quite some time in an unfinished form. For context, the icon for this Workflow was the first one I made in the new style. Looking at RemoveQuarantine, this has existed in a limited form for between six and twelve months. Most of its existence has been with just the GUI and adding as unread (I used PinUnread to fill the gap I needed).


Quite frankly, I considered not releasing the Workflow at all. On the other hand, in its current state getting the GUI is seamless, and most important, optional. One can still take advantage of all the features and use PinAdd to add bookmarks if they so wish.


Electron has awful tradeoffs, I agree, but realistically my choices were: have it with everything I need, done fast (due to great documentation), and updated (Electron); having it crippled, subpar documentation, abandoned or slow on fixes (other frameworks); not have it at all because I can’t even find the documentation for the features I wanted (Cocoa). I picked “having it with everything”. For people who disagree, I left the option to not have it at all (since the GUI is only downloaded in the single case of adding a bookmark, which is but a tiny part of the Workflow).

 

This is one of those rare Workflows where the primary user is myself, and it’s one of my most used ones (together with DownVid and WatchList). I hope to one day have the GUI be native. Following this post is likely the best way to know if that ever happens.

Link to comment

Thanks for the interesting explanation.

 

On 28/07/2017 at 10:02 PM, vitor said:

Following this post is likely the best way to know if that ever happens.

 

TBH, I just use a script that runs the Pinboard bookmarklet in the same tab. Have it mapped to ⌘⇧P in Safari and Chrome.

 

I have my own (unreleased) workflow for browsing my bookmarks (because who doesn't?), but yeah, like you say, Alfred isn't really suitable for making a great "add" UI. I might have a crack at it one day, though. I've already written a decent "tagging" UI in MailTo, which is the critical bit, imo.

 

The big problem with a native GUI (apart from figuring out how Cocoa works) is that it'd presumably have to have some level of integration with Pinboard in order to suggest tags, rather than just be a big, dumb form.

 

The huge advantage of a native Cocoa version vs Electron/QT/etc. is that it would start instantly.

 

Edited by deanishe
Grammar is hard
Link to comment
On 28/07/2017 at 11:06 PM, deanishe said:

TBH, I just use a script that runs the Pinboard bookmarklet in the same tab.

 

Dammit, that’s a good idea. And with AlfredBookmarklet I’ve already done all the work to running Javascript in Chrome and Safari. I may just change the solution to that.

 

On 28/07/2017 at 11:06 PM, deanishe said:

but yeah, like you say, Alfred isn't really suitable for making a great "add" UI

 

A big issue is that we have several things we might want to change from the default when adding a bookmark: title, URL (to remove utm parameters, for example), tags, description (I sometimes add it, sometimes I don’t). And when using Alfred we need to optimise for some of those in detriment of the others. Trouble is no two additions are the same. Most of the time I care more about tags, but when I care about the description or title, I really care for it.

 

On 28/07/2017 at 11:06 PM, deanishe said:

The big problem with a native GUI (apart from figuring out how Cocoa works) is that it'd presumably have to have some level of integration with Pinboard in order to suggest tags, rather than just be a big, dumb form.

 

That’s part of the reason I like loading the add page directly (which can also be done in Cocoa, naturally). We get all the suggestion goodness for free. But Pinboard’s API does also have an endpoint for suggested tags (https://api.pinboard.in/v1/posts/suggest).

Edited by deanishe
Hidin' my typos in Vítor's post…
Link to comment

Updates:

  • pa now calls bookmarklet instead of PinPlus GUI. That means no more huge download, and no reason for anyone to not use pa. Pinboard’s GUI is awful, though, so I’m still up for the native GUI solution if anyone wants to help.
  • Don’t run the unread action when opening bookmark on site.


To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.
Link to comment
1 hour ago, deanishe said:

Can't you release the theme you made for the PinPlus GUI as a userscript?

 

Not an option I like. I wouldn’t use it myself. In Chrome we used to be able to just drag a user style into the Extensions page and it would work, but now you can’t (you have to convert it to an extension).

 

Just like I use JXA to open the new window, I could use it to introduce the styling. But I don’t really like that as well since there needs to be a delay between running the bookmarklet and running the styling code (to account for Chrome opening the new window that we have to detect). That will cause a flash of unstyled content. In principle, such a flash isn’t that bad and actually good for usability. In practice, in this case you’d see it every time, and that’ll get annoying really fast.

Link to comment
16 minutes ago, deanishe said:

Have you tried Tampermonkey or does that not work any more?

 

Probably does, but I don’t want to install an extension to use userscripts. I like to have as few as possible installed, and I don’t have enough userscripts that I want to use to justify that.

Link to comment

This seems very useful, but I can't get it to work. I am able to use the PinPlus.app GUI to add a bookmark to my Pinboard account. But when using the 'pa', 'pin, 'pun' and ':pinplusforceupdate' keywords in Alfred nothing happens. I was prompted once for the Pinboard token and haven't been prompted again. I'm on macOS 10.12.6, Alfred 3.4.1 and use version 1.1.1 of the PinPlus workflow. Below I paste the debugging info after running "pin". Any ideas?

 

 

[2017-08-09 13:54:25][ERROR: input.scriptfilter] Code 1: /Users/MyUserName/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.4064276A-EABF-45AA-8CC9-180353BE7304/pinplus.rb:94:in `read': No such file or directory - /Users/MyUserName/Library/Application Support/Alfred 3/Workflow Data/com.vitorgalvao.alfred.pinplus/last_access_file.txt (Errno::ENOENT)
    from /Users/MyUserName/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.4064276A-EABF-45AA-8CC9-180353BE7304/pinplus.rb:94:in `unsynced_with_website?'
    from /Users/MyUserName/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.4064276A-EABF-45AA-8CC9-180353BE7304/pinplus.rb:145:in `fetch_bookmarks'
    from /Users/MyUserName/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.4064276A-EABF-45AA-8CC9-180353BE7304/pinplus.rb:137:in `show_bookmarks'
    from /Users/MyUserName/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Scripts/FD178B43-92E4-4B99-A710-7A20C7CDDAE7:3:in `<main>' 

Edited by cands
Link to comment
  • 4 weeks later...

@vitor this is what i get when I run the debugger:

 

[2017-09-09 11:30:53][input.keyword] Processing output of 'action.script' with arg ''
[2017-09-09 11:30:53][action.script] Processing output of 'action.script' with arg ''

 

When i use the pa command and hit enter. A browser window never pops up to input links or tabs.  

Link to comment

Update.


Takes advantage of the upcoming match feature in Script Filters for more powerful filtering. You’ll need to be using a pre-release version of Alfred to take advantage of the feature now. Keep in mind it’s subject to change.


To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Edited by vitor
Link to comment
  • 2 weeks later...

Hi,

 

Great work on this :)

 

I wanted to give you a little bit of feedback. I have created a trigger for searching and I noticed that it seems to start by downloading the favourites. It says something like "Fetching bookmarks". It just takes a few milliseconds, but stops me from being immediately able to write my search. Because if I write while it is fetching the bookmarks the characters will not register. So if I click on shortcut and start writing "devianart" it will miss the first character.

 

I wonder if the result could simply be cached. And perform the update maybe every 1 hour. Or maybe make the update only after I actually select a result.

 

I see here (https://github.com/vitorgalvao/alfred-workflows/blob/master/PinPlus/source/pinplus.rb#L142)  that the first thing it does it fetching the results. Isn't it possible to store this in memory so that there is no delay?

 

Secondly, is there a way to have fuzzy search for the url?    If I search for "art" then I would expect "https://www.deviantart.com" to show.

 

Thanks!

Link to comment
55 minutes ago, Nerian said:

Because if I write while it is fetching the bookmarks the characters will not register. So if I click on shortcut and start writing "devianart" it will miss the first character.

 

What do you mean "trigger"? How are you executing the workflow? It sounds very much like you're trying to enter your query before Alfred is ready to accept it. If the first character is missing in Alfred's search box, that's between you and Alfred: no workflow has any influence over that.

 

If you look more closely at the code, you'll see that the workflow does cache your bookmarks for 10 minutes. After that, it queries the Pinboard API to ask if your bookmarks have been updated since it last cached them. Only if they have will it download your bookmarks again. The "Fetching bookmarks…" text is the placeholder Alfred shows until the workflow returns results.

 

58 minutes ago, Nerian said:

Isn't it possible to store this in memory so that there is no delay?

 

No: Workflows don't work that way. The workflow script is run anew each time you use the workflow. Basically, this workflow is as fast as a workflow written in a scripting language can be.

 

1 hour ago, Nerian said:

Secondly, is there a way to have fuzzy search for the url?

 

Short answer: No. Your best bet here is to ensure that your deviantart.com bookmark has the individual word "art" in its title or to tag it with "art" and do the same, mutatis mutandis, for your other bookmarks.

 

Long answer: The workflow makes a fundamental trade-off between lightning fast search (using Alfred's search) and the odd delay while it updates, plus the limited flexibility of Alfred's search (i.e. not fuzzy). The delays could be removed and fuzzy search implemented, but at the cost of a ~25x reduction in search speed.

 

Personally, I'd increase the between-checks time to an hour or more to reduce the frequency of API calls, but that's about the only dial there is to twist.

 

Link to comment

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...