Editorial Workflows

URL as text using Requests

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: Demonstration of getting text of HTML file using Requests instead of urllib which generates too many Unicode errors.

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
A document must be open... ?
Run the block if
File Name
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
ON
Message
No Document Selected
…End If
Request Text Input ?
Title
enter URL
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import requests

action_in = workflow.get_input()

#TODO: Generate the output...

r = requests.get(action_in)
textout = r.text
action_out = textout

workflow.set_output(action_out)
Set Variable ?
Variable Name
textin
Value
Input
Document Text ?
Folded Text
  • Include
  • Replace with:
Extend Selection ?
Direction
  • Backward
  • Forward
  • Both
Unit
  • Start/End of Document
  • Start/End of Line
  • Number of Characters...
1
Replace Selected Text ?
Replacement Text
textin