Add Pinboard Note

Posted by kjaymiller, Last update over 5 years ago

Pinboard doesn’t natively support adding to notes (you can list a single or all notes with their API. More information at [])

This shortcut takes your draft and adds it to a new note in Pinboard.

The inspiration for this was from HyShai’s Pinote module which does something similar using python to make a request.


  • script

    // See online documentation for examples
    // get username and password from credentials
    var credential = Credential.create("Pinboard", "Allow Login to the Pinboard Site for Requests. ONLY USE FOR ACTIONS NOT COVERED BY THE PINBOARD API")
    credential.addTextField("username", "Username");
    credential.addPasswordField("password", "Password");
    http = HTTP.create()
    var response = http.request({
    	    'url': '',
    	    'method': 'POST',
    	    'data': {
    	        'username': credential.getValue('username'),
    	        'password': credential.getValue('password')},
    	    'encoding': 'form'
    menu = Prompt.create()
    menu.title = "New Pinboard Note"
    menu.message = "Add a new note to your Pinboard Account"
    menu.addTextField('title','Title', draft.processTemplate('[[title]]'))
    menu.addTextField('tags', 'Tags', draft.tags.join(', '), {'placeholder': 'Enter Tags: comma-separated'})
    menu.addTextView('note', 'Note', draft.processTemplate('[[body]]'))
    menu.addSwitch('markdown', 'Markdown', true)
    menu.addSwitch('private','Private', true)
    menu.addButton('Add Note','ok')
    m =
    if (m) {
    	title = menu.fieldValues['title']
    	tags = menu.fieldValues['tags']
    	note = menu.fieldValues['note']
    	if (menu.fieldValues['markdown']) {
    		var markdown = '1'
    	else {
    		var markdown = '0'
    	if (menu.fieldValues['private']) {
    		var set_private = 'private'
    	else {
    		var set_private = 'public'
    	var response2 = http.request({
    		'url': '',
    		'method': 'POST',
    		'data': {
    			'title': title,
    			'tags': tags,
    			'note': note,
    			'use_markdown': markdown,
    			'submit': 'save_ ' + set_private,
    			'action': 'save_' + set_private
    		'username': credential.getValue('username'),
    		'password': credential.getValue('password'),
    		'headers': {'User-Agent': 'Drafts for IOS'},
    		'encoding': 'form'


  • After Success Archive , Tags: pinboard
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.