Editorial Workflows

App Store Search

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: Performs an App Store Store search based on Pedro Lobo's App Store Linker workflow.
The result you choose will be copied to the clipboard.

You need to set your affiliate token and the list limit (the search won't always return the correct match in the first case) in the variables before running this workflow for the first time.

Shared by: @devsl

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
AffiliateLink
Value
10l5UB
Set Variable ?
Variable Name
ListLimit
Value
10
Request Text Input ?
Title
What is the app's name?
Initial Text
Selected Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
AppName
Value
Input
If AppName is Empty ?
Run the block if
AppName
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
Show Alert ?
Title
App Platform
Message
What platform was the app built for?
Button 1
Mac
Output Value
macSoftware
Button 2
iPhone
Output Value
software
Button 3
iPad
Output Value
iPadSoftware
Show Cancel Button
ON
Set Variable ?
Variable Name
Entity
Value
Input
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import requests
import urllib2


# Define some needed parameters
itunes_search = 'https://itunes.apple.com/search'

affiliateLink = workflow.get_variable('AffiliateLink')
listLimit = workflow.get_variable('ListLimit')
entity = workflow.get_variable('Entity')
app = workflow.get_variable('AppName')


payload = {'media':'software','limit':listLimit,'entity':entity,'term':app}

r = requests.get(itunes_search, params=payload)
data = r.json()

i = 0
appList=[]

for apps in data['results']:
	appUrl = urllib2.quote(data['results'][i]['trackViewUrl'] + '&at=affiliateLink', '')
	appUrl = urllib2.quote(appUrl, '')
	
	appName = data['results'][i]['trackCensoredName'] + ' (by '+data['results'][i]['sellerName'] + ')\t' + appUrl
	appList.append(appName)
	i = i+1

action_out = '\n'.join(appList)

workflow.set_output(action_out)
Select from List ?
Title
Here are the results:
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
ON
Generate Text ?
Text
Input
Find / Replace ?
Find
%252F
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
/
Find / Replace ?
Find
%253A
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
:
Find / Replace ?
Find
%253F
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
?
Find / Replace ?
Find
%253D
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
=
Find / Replace ?
Find
%2526
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
&
Find / Replace ?
Find
affiliateLink
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
AffiliateLink
Set Clipboard ?
Done! ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
ON
Message
Done!