- label: ASK FOR USERS
type: ask
param: input
message: |-
Send me a list of profiles either as:
1. @usernames separated by commas, e.g.:
```
@harpa.ai, @chrome, @extension
```
2. JSON with URLs, e.g.:
```json
[
{
"url": "https://www.instagram.com/harpa.ai/"
},
{
"url": "https://www.instagram.com/username/"
}
]
```
options: null
default: ''
vision:
enabled: false
mode: area
hint: ''
send: true
- label: EXTRACT USERNAMES
type: group
steps:
- type: js
code: |-
function extractUsernames(input) {
let usernames = [];
// Convert input to string
const inputStr = String(input);
// Unified regex to extract @mentions and Instagram URLs
const usernameRegex = /@(\w+(\.\w+)*(\_\w+)*(\.\w+)*)|https:\/\/www\.instagram\.com\/([\w\.]+)/g;
let matches;
// Search through the string input for usernames and URLs
while ((matches = usernameRegex.exec(inputStr)) !== null) {
// Push the non-null match group, either mention or URL segment
usernames.push(matches[1] || matches[5]);
}
return usernames;
}
// Using the function, assuming input is already defined
return extractUsernames(input);
args: input
param: list
timeout: 15000
silent: true
- condition: '{{list.length}} = 0'
label: FAIL
type: group
steps:
- type: say
message: โ๏ธ Unrecognised @username or URL format.
- type: jump
to: ASK FOR USERS
- label: ASK ACTION
type: ask
param: action
message: '{{list.length}} usenames extracted.'
options:
- label: โ
FOLLOW ALL
value: follow
- label: โ UNFOLLOW
value: unfollow
vision:
enabled: false
mode: area
hint: ''
send: true
default: ''
optionsInvalid: false
- label: ASK SPEED
type: ask
param: delay
message: >-
๐ก Choose an option or enter a custom delay in milliseconds (1 min = 60 sec
= 60000 ms).
options:
- label: โฉ NORMAL (30 sec.)
value: 30000
- label: โถ๏ธ SLOW (5 min.)
value: 300000
- label: โญ FAST (10 sec.)
value: 10000
- $custom
vision:
enabled: false
mode: area
hint: ''
send: true
default: ''
optionsInvalid: false
- type: loop
list: list
steps:
- type: calc
func: clone
from: item
to: username
- label: NAVIGATE
type: group
steps:
- type: say
message: >-
๐ Navigating to
**[@{{username}}](https://www.instagram.com/{{username}}/)**'s
profile.
- type: navigate
url: https://www.instagram.com/{{username}}/
waitForIdle: false
silent: true
- type: wait
for: 2s
silent: true
- condition: '{{action}} = follow'
label: FOLLOW
type: group
steps:
- type: click
selectorType: ai
selector:
- $matches:
- $tag: BUTTON
- $role: button
- $class: _acan
- $class: _acap
- $class: _acas
- $class: _aj1-
- $class: _ap30
- $attribute: type=button
- $style: '-apple-system:14px:600:normal'
- $content: Follow
- $class: x150jy0e
traverse: '-1'
- $class: x1e558r4
traverse: '-1'
- $class: xxz05av
traverse: '1:0:0:0'
- $class: xkfe5hh
traverse: '1:0:0:0'
- $class: xg1prrt
traverse: '0:1:0:0:0'
- $anchor: TAGGED
shift: 23:-184
min: 6
- $size: 1
item:
type: element
container:
__$ht: element
id: 0
value: Follow
silent: true
- type: click
selectorType: ai
selector:
- $matches:
- $tag: BUTTON
- $role: button
- $class: _acan
- $class: _acap
- $class: _acas
- $class: _aj1-
- $class: _ap30
- $attribute: type=button
- $style: '-apple-system:14px:600:normal'
- $content: Follow Back
- $class: xxz05av
traverse: '1:0:0:0'
- $class: xkfe5hh
traverse: '1:0:0:0'
- $class: xg1prrt
traverse: '0:1:0:0:0'
- $class: x1quol0o
traverse: '0:1:0:0:0'
- $anchor: This account is private
shift: 148:-208
- $text: This account is private
traverse: '-7:0:1:0:1:0:0:0'
min: 10
- $size: 1
item:
type: element
container:
__$ht: element
id: 1
value: Follow Back
silent: true
- type: wait
for: 1s
silent: true
- type: say
message: >-
**[@{{username}}](https://www.instagram.com/{{username}}/)**
followed!
- condition: '{{action}} = unfollow'
label: UNFOLLOW
type: group
steps:
- type: click
selectorType: ai
selector:
- $matches:
- $tag: BUTTON
- $role: button
- $class: _acan
- $class: _acap
- $class: _acat
- $class: _aj1-
- $class: _ap30
- $attribute: type=button
- $style: '-apple-system:14px:600:normal'
- $content: Following
- $class: x150jy0e
traverse: '-1'
- $class: x1e558r4
traverse: '-1'
- $class: xxz05av
traverse: '1:0:0:0'
- $class: xkfe5hh
traverse: '1:0:0:0'
- $class: xg1prrt
traverse: '0:1:0:0:0'
min: 6
- $size: 1
item:
type: element
container:
__$ht: element
id: 2
value: Following
silent: true
- type: wait
for: 1s
silent: true
- type: click
selectorType: ai
selector:
- $matches:
- $tag: DIV
- $class: x9f619
- $class: xjbqb8w
- $class: x78zum5
- $class: x168nmei
- $class: x13lgxp2
- $class: x5pf9jr
- $class: xo71vjh
- $class: x1pi30zi
- $class: x1swvt13
- $class: x1l90r2v
- $class: xyamay9
- $class: x1uhb9sk
- $class: x1plvlek
- $class: xryxfnj
- $class: x1c4vz4f
- $class: x2lah0s
- $class: xdt5ytf
- $class: xqjyukv
- $class: x1qjc9v5
- $class: x1oa3qoh
- $class: x1nhvcw1
- $style: '-apple-system:14px:400:normal'
- $content: Unfollow
- $class: x7r02ix
traverse: '0:0:0:7:0'
- $class: xf1ldfh
traverse: '0:0:0:7:0'
- $class: x131esax
traverse: '0:0:0:7:0'
- $class: xdajt7p
traverse: '0:0:0:7:0'
- $class: xxfnqb6
traverse: '0:0:0:7:0'
- $anchor: Restrict
shift: '0:50'
- $text: Restrict
traverse: '-9:7:0'
- $anchor: Mute
shift: '0:100'
min: 24
- $size: 1
item:
type: element
container:
__$ht: element
id: 3
value: Unfollow
silent: true
- type: wait
for: 1s
silent: true
- type: say
message: >-
โ **[@{{username}}](https://www.instagram.com/{{username}}/)**
unfollowed!
- type: wait
for: custom-delay
delay: '{{delay}}'
- condition: '{{action}} = follow'
type: say
message: โ๏ธ {{list.length}} followed.
- condition: '{{action}} = unfollow'
type: say
message: โ๏ธ {{list.length}} unfollowed.
This automation command is created by a community member. HARPA AI team does not audit community commands.
Please review the command carefully and only install if you trust the creator.
All rights reserved ยฉ HARPA AI TECHNOLOGIES LLC, 2021 โ 2024
Designed and engineered in Finland ๐ซ๐ฎ