Editorial Workflows

Get App Price

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: Queries the iTunes Store API to search for an app's name, returns formatted name and price (in USD) in a popover.

The workflow can optionally create an affiliate link if affiliate information is provided in two variables at the top.

More information on affiliate links and iTunes Search API:

http://www.apple.com/itunes/affiliates/

http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html#searching

Shared by: @viticci

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Affiliate Token ?
Variable Name
aff_token
Value
&at=YOUR_TOKEN_HERE
Affiliate Campaign Tracking ?
Variable Name
aff_ct
Value
&ct=YOUR_CAMPAIGN_HERE
Choose App Type ?
Title
Select App Type
List (Lines)
iPhone software iPad iPadSoftware Mac macSoftware
Multiple Selection
OFF
Show in Popover
ON
Set Variable ?
Variable Name
entity
Value
Input
Request Text Input ?
Title
App Name
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
appname
Value
Input
URL Escape ?
Set Variable ?
Variable Name
URL
Value
http://itunes.apple.com/search?term=Input&country=us&media=software&entity=entity
Run Python Script ?
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'])
		output = '\n'.join(s)
		workflow.set_output(output)
Select from List ?
Title
App Store Results
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
ON
Create Affiliate Link ?
Variable Name
itunesurl
Value
Inputaff_tokenaff_ct
Replace Selected Text ?
Replacement Text
[Selected Text](itunesurl "appname")
Generate Text ?
Text
itunesurl
Set Affiliate Link to Clipboard ?