Editorial Workflows

Shorten TinyURL

unlisted workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: 選択したURLをTinyURLで短縮します。

Shared by: @hals_pg

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Selected Text ?
Entire Line(s)
OFF
Empty Selection Output
  • No Output
  • All Text
  • Closest Word
Folded Text
  • Include
  • Replace with:
Set Variable ?
Variable Name
Source
Value
Input
Find ?
Search for
://
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
://
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import urllib

source = workflow.get_input()
url = urllib.quote(source.encode('utf-8'))
api = 'http://tinyurl.com/api-create.php?url='
req = api + url
out = urllib.urlopen(req).read()
workflow.set_output(out)
Set Variable ?
Variable Name
TinyURL
Value
Input
Show Alert ?
Title
Message
短縮URLで置換しますか?
Button 1
はい
Output Value
ok
Button 2
両方
Output Value
both
Button 3
(don't show)
Output Value
Show Cancel Button
OFF
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
ok
Replace Selected Text ?
Replacement Text
TinyURL
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
Replace Selected Text ?
Replacement Text
Source TinyURL
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Show HUD ?
HUD Text
URLを選択してから実行してください
Duration
  • 1 Second
  • 2 Seconds
  • 3 Seconds
Icon
  • "Success"
  • "Error"
…End If