Skip to content

Instantly share code, notes, and snippets.

javascript:window.location='drafts://x-callback-url/create?text='+encodeURIComponent(document.title+'\n')+encodeURIComponent(location.href)+'&action=pinbook-desc'
@jkishner
jkishner / youtube2fargo
Created June 28, 2013 15:18
The template for a Drafts Dropbox action to your /Apps/Fargo folder
<?xml version="1.0" encoding="UTF-8"?>
<opml version="2.0">
<head>
<title>Video</title>
</head>
<body>
<outline text="[[title]]" type="outline" created="[[date|%a, %d %b %Y %T EDT]]" isFeedItem="true">
<outline text="&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/[[body]]&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;"/>
</outline>
</body>
Gmail to Pushover
key = "YOUR_PUSHOVER_KEY_HERE";
a = op.getLineText();
b = encodeURIComponent(a);
c = b.replace(/%/g,"%25");
dialog.ask ("Drafts Action?", "", "Enter it here", function (name) {
action = encodeURIComponent(name);
actionrep = action.replace(/%/g,"%25");
notification = "drafts:///create?text=" + c + "%26action=" + actionrep;<br>
var long = notification.length + 5;
Pushover Count
a = op.getLineText();
b = encodeURIComponent(a);
c = b.replace(/%/g,"%25");
p = "drafts:///create?text=" + c + "%26action=";
l = p.length;
dialog.alert ("This encoded headline contains " + l + " characters.");
Tweet Trex
var text = op.getLineText();
var link = op.getCursorUrl();
window.open("https://twitter.com/share?text=" + text + "&url=" + link,"_blank");
@jkishner
jkishner / TweetBlog
Last active December 20, 2015 12:29
TweetBlog
var text = op.getLineText();
dialog.ask ("Enter link below", "", "", function (name) {
op.attributes.setOne("type", "link");
op.attributes.setOne("url", name);
var url = op.attributes.getOne ("url");
window.open("https://twitter.com/share?text=" + text + "&url=" + url,"_blank");
var date = clock.now().toDateString();
op.insert ("Posted: " + date, up);
op.attributes.setOne("icon", "twitter-sign");
Move Child to Next Parent
op.reorg (left, 1);
op.reorg (down, 1);
op.reorg (right, 1);
@jkishner
jkishner / todo
Created August 6, 2013 15:04
for Fargo.io: adds a checkbox to a headline that has no icon; if the icon is "check-empty" it changes it to "check"; if the icon is "check" it makes the headline a child of the last headline in the outline and then collapses that parent headline
todo
var value = op.attributes.getOne ("icon");
if (!value) {
op.attributes.setOne ("icon", "check-empty");
}
else if (value == "check-empty") {
op.attributes.deleteOne ("icon");
op.attributes.setOne ("icon", "check");
}
else if (value == "check") {
@jkishner
jkishner / opml in wordpress
Created August 14, 2013 21:50
post an opml file as an unordered list in a wordpress post or page. just use the shortcode [opml url="OPML_URL"] in the content area. This is based on a php script by Betsy Kimak http://www.umaitech.com/cms/?p=311
<?php
/*
Plugin Name: OPML in WordPress
Author: Jeffrey Kishner
*/
function fargo2opml ($opmlfile) {
$opmfile = shortcode_atts(array(
'url' => '',
@jkishner
jkishner / Convert to Music Map in Fargo
Created October 29, 2013 19:47
use this script in Fargo on a headline containing a band/musician name. the script will insert (as a child) a link to that band on music-map.com
convert to Music-Map
var band = op.getLineText();
band = band.trim();
var newband = band.replace(" ","+");
var link = 'http://www.music-map.com/' + newband + '.html';
op.insert('Music-Map',right);
op.attributes.setOne("type","link");
op.attributes.setOne("url",link);
op.attributes.setOne("icon","map-marker");