Editorial Workflows

App Store search for Books & Apps

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: Search for books or apps in iBookStore and App Store, based on selection or typed query.

Replaces text or inserts Markdown link (with affiliate ID), followed with store pricing in brackets :

[App / Book Name](link) (price)

The workflow has comments and colors, with variables to be edited (Affiliate ID and Store country).

Feel free to contact me for questions or new features.

Thanks to @viticci for the query script from his "Get App Price" workflow.

Shared by: @bpepermans

Comments: Comment Feed (RSS)

Urbanbike — 27 Dec 2014
Excellent Benoit. I want the same for French users. Thanks for the price.

+ Add Comment

Workflow Preview
Affiliate ID (if you have one) ?
Variable Name
AffiliateToken
Value
10lus3
App Store country location (FR, US, ES, ...) ?
Variable Name
Locale
Value
FR
Set Variable ?
Variable Name
SearchType
Value
Search
Get selected text / search subject (if any) ?
Entire Line(s)
OFF
Empty Selection Output
  • No Output
  • All Text
  • Closest Word
Folded Text
  • Include
  • Replace with:
Set Variable ?
Variable Name
AppSearchName
Value
Input
If text selected, asks for query subject ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Choose search type : new query or based on selection ?
Title
Search type
Message
Search for new query terms or for selected text ("Input") ?
Button 1
Search for...
Output Value
Search
Button 2
Selection
Output Value
Select
Button 3
(don't show)
Output Value
Show Cancel Button
ON
Set Variable ?
Variable Name
SearchType
Value
Input
…End If
If "new query", ask for terms ?
Run the block if
SearchType
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Search
Query terms prompt ?
Title
Your search...
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
AppSearchName
Value
Input
…End If
Kind of media to search for (Apps or Books) ?
Title
Search in...
List (Lines)
App Store (iOS & OS X) software iBookStore ebook
Multiple Selection
OFF
Show in Popover
OFF
Set Variable ?
Variable Name
SearchMedia
Value
Input
Ask for app type (iPhone, iPad or Mac) ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
software
Select app kind from list ?
Title
App kind ?
List (Lines)
iPhone software iPad iPadSoftware Mac macSoftware
Multiple Selection
OFF
Show in Popover
ON
…End If
Set Variable ?
Variable Name
entity
Value
Input
Generate Text ?
Text
AppSearchName
URL Escape ?
Set Variable ?
Variable Name
URL
Value
http://itunes.apple.com/search?term=Input&country=Locale&media=SearchMedia&entity=entity
Set Variable ?
Variable Name
AppPrice
Value
-
App Store Query, fetch results (name, link & price) ?
Source Code
import requests
import workflow
import console

# Given a proper iTunes Search URL, returns a list of results that is passed to the next action with app name, formatted price, and iTunes URL.

iTunesURL = workflow.get_variable('URL')

j = requests.get(iTunesURL)
# print j.json()['results']
s = []

if j.status_code != 200:
	print 'Could not fetch items.\n', j.text
    
elif j.status_code == 200:
	for item in j.json()['results']:
		console.show_activity('Building list...')
		s.append(item['trackName'] + ' (' + item['formattedPrice'] + ')	' + item['trackViewUrl']+'|'+item['formattedPrice'])
		output = '\n'.join(s)
		workflow.set_output(output)
Select app from results ?
Title
Store Results...
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
ON
Extract price from selected result ?
Source Code
import workflow

UrlAndPrice = workflow.get_input()

url, price = UrlAndPrice.split('|')
workflow.set_variable('AppPrice', price)

workflow.set_output(url)
Create iTunes URL ?
Variable Name
AppAffURL
Value
Input&at=AffiliateToken
Generate Markdown item link with price ?
Replacement Text
[AppSearchName](AppAffURL) (AppPrice)
Generate Text ?
Text
AppAffURL
Copy URL to clipboard for reuse ?
Display clipboard confirmation ?
HUD Text
Link copied to the clipboard.
Duration
  • 1 Second
  • 2 Seconds
  • 3 Seconds
Icon
  • "Success"
  • "Error"