Editorial Workflows

New Link

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: Editorial implementation of my New Link macro from Markdown for Keyboard Maestro.

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
If no selection exists, select closest work ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Select Closest Word ?
Set Variable ?
Variable Name
readable text
Value
Input
…End If
If selection exists just set variable ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Set Variable ?
Variable Name
readable text
Value
Selected Text
…End If
Text that will be readable ?
Title
Readable text
Initial Text
readable text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
readable text
Value
Input
When clipboard has no URL, ask for one ?
Run the block if
Clipboard
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
http
Request Text Input ?
Title
URL to extract title from:
Initial Text
http
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
url
Value
Input
…End If
When clipboard has URL, show it and ask if it's the one to be used ?
Run the block if
Clipboard
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
http
Generate Text ?
Text
Clipboard
Extract URLs ?
Output
  • Only URLs
  • URLs and Ranges (Separated by Tab)
Get URL to extract from ?
Title
URL to extract title from:
Initial Text
Input
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
url
Value
Input
…End If
Get title of URL ?
Source Code
#coding: utf-8
import workflow
import urllib2
from bs4 import BeautifulSoup

action_in = workflow.get_input()

#fetch html
url = action_in
u = urllib2.urlopen(url)
source = u.read(40000)
u.close

#parse with BeautifulSoup
BS = BeautifulSoup(source)

#search for title element, print element.text
action_out = BS.find('title').text

workflow.set_output(action_out)



# import urllib
#u = urllib.urlopen('http://stackoverflow.com')
#x = u.read(1000)
#u.close()
Set Variable ?
Variable Name
title
Value
Input
Generate Text ?
Text
[readable text](url "title")
Replace Selected Text ?
Replacement Text
Input