Editorial Workflows

Send to OMZ Forums in Built-in Browser

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: This workflow sends the current document to the omz:software forums. The post's title will be the name of the file and the content will be the content of the file.

This runs in Editorial's built-in browser, so you will need to have logged in to the OMZ forums there prevously.

This is based on "Send to OMZ Forums" by Rainman Noodles. This workflow doesn't require a browser bookmarklet to have been set up first.

See this thread for the background: https://omz-forums.appspot.com/editorial/post/5904205676019712

@ClareMacraeUK, 27 December 2014.

Shared by: @ClareMacraeUK

Comments: Comment Feed (RSS)

Tutorial Doctor — 29 Dec 2014
Thank you!

+ Add Comment

Workflow Preview
Get Current File Name ?
Include Folder
OFF
Include Extension
OFF
Set Variable ?
Variable Name
posttitle
Value
Input
Document Text ?
Folded Text
  • Include
  • Replace with:
Set Variable ?
Variable Name
postcontent
Value
Input
Select from List ?
Title
Which forum?
List (Lines)
Pythonista Editorial
Multiple Selection
OFF
Show in Popover
ON
Set Variable ?
Variable Name
forum
Value
Input
If… ?
Run the block if
forum
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Editorial
Select from List ?
Title
Category
List (Lines)
General Workflows Questions
Multiple Selection
OFF
Show in Popover
ON
Set Variable ?
Variable Name
category
Value
Input
…End If
If… ?
Run the block if
forum
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Pythonista
Select from List ?
Title
Category
List (Lines)
General Share Code Questions
Multiple Selection
OFF
Show in Popover
ON
Set Variable ?
Variable Name
category
Value
Input
…End If
Run Python Script ?
Source Code
#coding: utf-8
import workflow
#import clipboard
import urllib

forumname = workflow.get_variable('forum').lower()
categoryname = workflow.get_variable('category')
#print 'Forum: '+forumname
#print 'Category: '+categoryname

posttitle = workflow.get_variable('posttitle')
postcontent = workflow.get_variable('postcontent')
#print 'Title: '+posttitle
#print 'Content: '+postcontent

url = 'https://omz-forums.appspot.com/'+forumname+('/new?category=%s&omztitle=%s&omzcontent=%s' % (urllib.quote(categoryname), urllib.quote(posttitle), urllib.quote(postcontent)))

workflow.set_output(url)
Open URL ?
Open in
  • In-App Browser
  • Default App / Safari
URL
Input
Tab
  • Last-used Tab
  • New Tab
  • Tab with ID:
Unique identifier
Wait until Loaded
ON
Reveal Browser Automatically
ON
Evaluate JavaScript ?
Source
var urls = window.location.href.split('?'); if (urls.length > 1) { var params = urls[1].split('&'); for (x = 0; x < params.length; x++) { var p = params[x].split('='); if (p.length == 2) { if (p[0] == 'omztitle') { var title = decodeURIComponent(p[1]); var titlebox = document.getElementsByName('title')[0]; titlebox.value = title; } else if (p[0] == 'omzcontent') { var content = decodeURIComponent(p[1]); var contentbox = document.getElementById('wmd-input'); contentbox.value = content } } } }