Editorial Workflows


public 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: Select the text in the editor you want the image to have. Be sure that the browser shows the web page where you want to pick an image from. Then invoke this workflow.
After a short while you'll be presented with an overview of all the images from that web page. Just tap on the one whose URL you want to have inserted into your markdown text as an inline link.
[This workflow needs the workflow "InsImgUrlB", too, to work!]

Shared by: @metawops

Comments: Comment Feed (RSS)

anonymous — 27 Jun 2014
Not working. Saying a command with some name is not found.
anonymous — 18 Dec 2014
Unfortunately this does not work. All you get are a few empty boxes which should presumably display images. After tapping on one of the boxes you get an error message.

A pity, this would be very useful.

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
Browser URL
If… ?
Run the block if
Browser URL
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Show HUD ?
HUD Text
Getting images. Stay tuned!
  • 1 Second
  • 2 Seconds
  • 3 Seconds
  • "Success"
  • "Error"
Get Images from Browser URL ?
Source Code
#coding: utf-8
import workflow
import requests
import urllib
from urlparse import urlparse
from bs4 import BeautifulSoup

action_in = workflow.get_input()
#print action_in
if action_in:

	#print "Browser URL:", action_in

	htmlDoc = requests.get(action_in).text
	origUrl = urlparse(action_in)

	soup = BeautifulSoup(htmlDoc)

	targetHtml = '<html><head></head><body>'
	#print "Images URLs:"
	#print "------------"
	for image in soup.find_all('img'):
		imgUrl = image.get('src')
		o = urlparse(imgUrl)
		if not o.scheme:
			imgUrl = origUrl.scheme + '://' + origUrl.netloc + '/' + imgUrl
	#	print imgUrl
		targetHtml += "<a href='editorial://?command=InsImgUrlB&input=" + urllib.quote(imgUrl) + "'><img src='" + imgUrl + "'></a>&nbsp;"

	targetHtml += "</body></html>"
	#print targetHtml

	action_out = targetHtml

Show HTML ?
Select one
Base URL
Show HUD ?
HUD Text
Tap on the image to be linked to.
  • 1 Second
  • 2 Seconds
  • 3 Seconds
  • "Success"
  • "Error"
Stop ?
  • This Workflow
  • Repeat Block
Show HUD Alert
…End If
Show HUD ?
HUD Text
Please enter a URL in the browser!
  • 1 Second
  • 2 Seconds
  • 3 Seconds
  • "Success"
  • "Error"