Editorial Workflows

Feed Wrangler - List of Stars

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: Connects to the Feed Wrangler API and returns your starred items into a popover. Clicking the popover will open the URL in Editorial. The Feed Wrangler password is stored in the Editorial keychain and will be created if it does not exist already. You need a Feed Wrangler API Client Key (http://feedwrangler.net/developers/clients) and email address defined in the first two set variables.

Shared by: ctaloi

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Set Feed Wrangler Client Key (Feed Wrangler API) ?
Variable Name
client_key
Value
Set Feed Wrangler Account Name (email address) ?
Variable Name
account_name
Value
Check for Feed Wrangler Client Key ?
Run the block if
client_key
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Open FW dev site if we don't have client key ?
Source Code
#coding: utf-8
import console
console.hud_alert('Need a Feed Wrangler Client ID', 'error', 2)
console.hud_alert('Opening Feed Wrangler Dev Portal...', 'success', 2)
Open URL ?
Open in
  • In-App Browser
  • Default App / Safari
URL
http://feedwrangler.net/developers/clients
Tab
  • Last-used Tab
  • New Tab
  • Tab with ID:
Unique identifier
Wait until Loaded
ON
Reveal Browser Automatically
ON
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
Check for Feed Wrangler Account Name (email address) ?
Run the block if
account_name
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Alert for missing email ?
Source Code
#coding: utf-8
import console
console.hud_alert('Need a Feed Wrangler Email Address', 'error', 2)
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
You need to enter your Feed Wrangler account name (email address) in the Workflow
…End If
Check keychain and add keys is applicable ?
Gather up starred items from Feed Wrangler ?
Source Code
#coding: utf-8
import workflow
import requests
import console
import keychain

""" Connect to Feed Wranglers API and pull your recent starred items into a list """
""" Original Source: https://gist.github.com/willvanwazer/6242581 """


ACCOUNT = workflow.get_variable('account_name')
CLIENT_KEY = workflow.get_variable('client_key')
PASSWORD=keychain.get_password('Feed Wrangler', ACCOUNT)
BASE='http://feedwrangler.net/api/v2/'

def get_stars():
	authorized_endpoint = BASE + 'users/authorize?email=%s&password=%s&client_key=%s' \
						% (ACCOUNT, PASSWORD, CLIENT_KEY)
	authorize = requests.get(authorized_endpoint)
	access_token = authorize.json()['access_token']
	star_endpoint = BASE + 'feed_items/list?starred=true&access_token=%s' \
						% access_token
	console.show_activity("Gathering up starred Feed Wrangler items")
	starred = requests.get(star_endpoint)
	output_list = []
	for starred_item in starred.json()['feed_items']:
		star_title = starred_item['title']
		star_url = starred_item['url']
		output_list.append(star_title + '\t' + star_url)
		output = '\n'.join(output_list)		
		workflow.set_output(output)
	return

def main():
    get_stars()

if __name__ == '__main__':
	main()
	
Select URL from List ?
Title
Feed Wrangler Starred Items
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
OFF
Show HUD ?
HUD Text
Opening Input
Duration
  • 1 Second
  • 2 Seconds
  • 3 Seconds
Icon
  • "Success"
  • "Error"
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
OFF
Reveal Browser Automatically
ON