Pastery

PasteryAction +

  1{  2  "actions" : [  3    {  4      "type" : "@flow.set-variable",  5      "parameters" : {  6        "value" : {  7          "value" : "{{YOURAPIKEY}}"  8        },  9        "name" : { 10          "value" : "apikey" 11        } 12      } 13    }, 14    { 15      "type" : "@editor.filename", 16      "parameters" : { 17        "mode" : 0, 18        "includeExtension" : false 19      } 20    }, 21    { 22      "type" : "@text.encode", 23      "parameters" : { 24        "mode" : 0, 25        "decode" : false, 26        "text" : { 27          "value" : "$", 28          "tokens" : [ 29            { 30              "location" : 0, 31              "value" : "@input" 32            } 33          ] 34        }, 35        "base64Options" : 0 36      } 37    }, 38    { 39      "type" : "@flow.set-variable", 40      "parameters" : { 41        "value" : { 42          "value" : "$", 43          "tokens" : [ 44            { 45              "location" : 0, 46              "value" : "@input" 47            } 48          ] 49        }, 50        "name" : { 51          "value" : "filename" 52        } 53      } 54    }, 55    { 56      "type" : "@text.encode", 57      "parameters" : { 58        "mode" : 0, 59        "decode" : false, 60        "text" : { 61          "value" : "$", 62          "tokens" : [ 63            { 64              "location" : 0, 65              "value" : "@editor.full-text" 66            } 67          ] 68        }, 69        "base64Options" : 0 70      } 71    }, 72    { 73      "type" : "@flow.set-variable", 74      "parameters" : { 75        "value" : { 76          "value" : "$", 77          "tokens" : [ 78            { 79              "location" : 0, 80              "value" : "@editor.full-text" 81            } 82          ] 83        }, 84        "name" : { 85          "value" : "body" 86        } 87      } 88    }, 89    { 90      "type" : "@util.request", 91      "parameters" : { 92        "body" : { 93          "value" : "$", 94          "tokens" : [ 95            { 96              "location" : 0, 97              "value" : "body" 98            } 99          ]100        },101        "url" : {102          "value" : "https:\/\/www.pastery.net\/api\/paste\/?title=$&api_key=$&language=markdown",103          "tokens" : [104            {105              "location" : 51,106              "value" : "apikey"107            },108            {109              "location" : 41,110              "value" : "filename"111            }112          ]113        },114        "method" : 1,115        "headers" : {116          "value" : "{\"Content-Type\": \"text\/plain\"}"117        }118      }119    },120    {121      "type" : "@flow.javascript",122      "parameters" : {123        "script" : {124          "value" : "\/\/ Get input\nconst text = $actions.inputValue;\n\nlet data = JSON.parse(text)\n\n\/\/ Resolve with output\n$actions.resolve(data.url);\n\n\/\/ Exception handling:\n\/\/  $actions.reject(\"Error\");\n\/\/  $actions.finish();"125        }126      }127    },128    {129      "type" : "@flow.set-variable",130      "parameters" : {131        "value" : {132          "value" : "$",133          "tokens" : [134            {135              "location" : 0,136              "value" : "@input"137            }138          ]139        },140        "name" : {141          "value" : "url"142        }143      }144    },145    {146      "type" : "@ui.toast",147      "parameters" : {148        "style" : 1,149        "waitUntilDone" : true,150        "title" : {151          "value" : "Paste created - URL passed to system clipboard"152        }153      }154    },155    {156      "type" : "@util.set-clipboard",157      "parameters" : {158        "mode" : 0,159        "localOnly" : false,160        "text" : {161          "value" : "$",162          "tokens" : [163            {164              "location" : 0,165              "value" : "url"166            }167          ]168        },169        "expireAfter" : {170          "value" : "0"171        }172      }173    },174    {175      "type" : "@util.open-url",176      "parameters" : {177        "url" : {178          "value" : "$",179          "tokens" : [180            {181              "location" : 0,182              "value" : "url"183            }184          ]185        },186        "fullScreen" : false,187        "browser" : 2188      }189    }190  ],191  "buildVersion" : 1,192  "name" : "Pastery",193  "clientMinVersion" : 1,194  "summary" : "Create a Pastery paste via API with the current document's contents. The result's URL will be passed to the system clipboard.\n\nYou'll need to change the value of the `apikey` variable to your own Pastery API key.\n\nSee Pastery's API documentation: https:\/\/www.pastery.net\/api",195  "icon" : {196    "glyph" : "arrow.triangle.2.circlepath.doc.on.clipboard",197    "color" : "#FB6666"198  },199  "clientVersion" : 842200}
New paste