HARPA.AI
LIBRARYUSE CASESGUIDESAI COMMANDSBLOG

❤️  Instagram Like Machine v2.1

Automatic like machine that LOOPs over lists of #hashtags or @usernames. Command saves already processed photos and settings, making runs more effective. #instagram

Created by Bohdan Kovtunenko
Updated on Nov 11, 08:14
Installed 153 times
RUNS JS CODE

How to Use

IMPORT COMMAND

Content

- type: group
  steps:
    - type: calc
      func: set
      param: likesCount
      format: number
      value: '0'
    - param: g.inst.likesDelay
      format: auto
      value: normal
      condition: '{{g.inst.likesDelay}} ='
      type: calc
      func: set
    - param: g.inst.comments
      value: 'no'
      condition: '{{g.inst.comments}} ='
      type: calc
      func: set
      format: auto
    - param: g.inst.commentStyle
      value: >-
        I need a brief comment from the HARPA AI team, mentioning that we
        stumbled upon them online. If suitable, mention something about our
        product, HARPA AI. HARPA AI is a Chrome Extension that can integrate AI
        into a user's daily tasks and automate their browser activities, helping
        achieve peak productivity and save time. If you see an AI-generated
        image in the screenshot, mention that HARPA AI can create great prompts
        for Midjourney. Also, HARPA have a large collection of prompt templates
        for generating images in various styles.
      condition: '{{g.inst.commentStyle}} ='
      type: calc
      func: set
      format: auto
    - param: g.inst.likesPerRun
      value: '10'
      condition: '{{g.inst.likesPerRun}} ='
      type: calc
      func: set
      format: auto
    - param: g.inst.target
      value: '@harpa.ai #harpaai'
      condition: '{{g.inst.target}} ='
      type: calc
      func: set
      format: auto
  label: DEFAULT SETTINGS
- message: >-
    👋 Hi, 

    - Keep this tab active in the browser window for liking to work correctly.

    - Avoid using this Instagram profile in other tabs while the automation is
    running.

    - Comments use Vision features. Make sure you're using the correct LLM, and
    we recommend reducing your active browser window size to minimize token
    usage.


    📣 For safety, we recommend not leaving more than 100 likes and 50 comments
    per day, using a delay of at least 5 sec after each action. You can speed up
    liking, risking temporary action blocks - it is up to you.
  type: say
  label: WELCOME
- steps:
    - steps:
        - param: comments
          format: ''
          value: |-
            YES, {{g.inst.commentsCount}} per @ or #.

            🔔 For successful commenting:
            - Do not touch this browser window or cover it with other windows.
            - Use a Vision-capable AI model (e.g., CloudGPT GPT-4o or API).
             
          condition: '{{g.inst.comments}} = yes'
          type: calc
          func: set
        - value: 'NO'
          condition: '{{g.inst.comments}} = no'
          type: calc
          func: set
          param: comments
          format: ''
      label: CHANGE WORDING
      type: group
    - type: ask
      param: speed
      message: |-
        ## Current actions frequency:

        **Likes per @ or #:** {{g.inst.likesPerRun}}

        **Delay:** {{g.inst.likesDelay}}

        **Leave comments:** {{comments}}
      options:
        - label: ✅ OK!
          value: ok
        - label: ⚙️ CUSTOMIZE
          value: customize
      vision:
        enabled: false
        mode: area
        send: true
        hint: ''
      label: ACTIONS FREQUENCY
      default: ''
      optionsInvalid: false
    - type: jump
      to: START ASK
      condition: '{{speed}} = ok'
    - message: >-
        💡 Choose an option or enter a custom delay in milliseconds (1 min = 60
        sec = 60000 ms).
      options:
        - label: ⏩ NORMAL (1-5 sec.)
          value: normal
        - label: ▶️ SLOW (10-20 sec.)
          value: slow
        - label: ⏭ FAST (0.5 sec.)
          value: fast
        - $custom
      type: ask
      param: g.inst.likesDelay
      default: ''
      optionsInvalid: false
    - message: '**Likes per @ or #:**'
      options:
        - label: 5 likes
          value: 5
        - label: 10 likes
          value: 10
        - label: 25 likes
          value: 25
        - $custom
      type: ask
      param: g.inst.likesPerRun
      default: ''
      optionsInvalid: false
    - steps:
        - message: Add comments?
          options:
            - label: ✅ YES
              value: 'yes'
            - label: ⛔ NO
              value: 'no'
          vision:
            enabled: false
            mode: area
            hint: ''
            send: true
          param: g.inst.comments
          type: ask
          default: ''
          optionsInvalid: false
        - to: CHANGE WORDING
          condition: '{{g.inst.comments}} = no'
          type: jump
        - message: How many comments do I need to generate per profile / hashtag?
          options:
            - label: 1 comment
              value: 1
            - label: 5 comments
              value: 5
            - label: 10 comments
              value: 10
            - $custom
          vision:
            enabled: false
            mode: area
            hint: ''
            send: true
          label: ASK HOW MANY
          param: g.inst.commentsCount
          condition: '{{g.inst.comments}} = yes'
          type: ask
          default: ''
          optionsInvalid: false
        - message: |-
            Enter your comment instructions.

            Currently:

            ```markdown
            {{g.inst.commentStyle}}
            ```
          vision:
            enabled: false
            mode: area
            hint: ''
            send: true
          label: ASK STYLE
          options: null
          default: ''
          type: ask
          param: g.inst.commentStyle
        - to: CHANGE WORDING
          type: jump
      label: ASK COMMENTS
      type: group
  label: SETTINGS
  type: group
- steps:
    - message: >-
        💬 Enter #hashtags or @usernames, separated by spaces or commas. You can
        mix them together.


        Or, choose from your last used:


        ```

        {{g.inst.target}}

        ```
      options:
        - label: ▶️ START
          value: start
        - label: ♻️ GENERATE HASHTAGS
          value: hashtags
        - $custom
      default: '@harpa.ai'
      label: ASK FOR INPUT
      param: input
      type: ask
      optionsInvalid: false
    - steps:
        - message: 💬 What's the topic?
          param: topic
          type: ask
          options: null
          default: ''
        - prompt: >-
            Please ignore all previous instructions. I want you to respond only
            in English. Create 20 simple 1 or 2 words Instagram hashtags
            targeting my [TOPIC].

            - Separate keywords by commas, write them with #. Only capitalize
            proper nouns. Output in a single line.

            - I need you to generate a list of basic hashtags that can be used
            to find many photos. 

            - Keep the hashtags simple, like a single word keywords.


            Wrap your response into a markdown code block. Example:

            ```markdown

            ...hashtags...

            ```


            [TOPIC]:

            {{topic}}


            [HASHTAGS]:
          type: gpt
          param: input
          silent: false
        - func: extract-code
          type: calc
          to: input
          param: input
          index: ''
        - param: ask-hashtags
          options:
            - label: ✅ START WITH HASHTAGS
              value: start
            - label: ⛔ MENU
              value: menu
          type: ask
          message: ''
          default: ''
          optionsInvalid: false
        - condition: '{{ask-hashtags}} = menu'
          type: jump
          to: ASK FOR INPUT
        - to: FIND NAMES OR HASHTAGS
          condition: '{{ask-hashtags}} = start'
          type: jump
      condition: '{{input}} = hashtags'
      label: GENERATE HASHTAGS
      type: group
    - func: clone
      condition: '{{input}} = start'
      type: calc
      from: g.inst.target
      to: input
    - code: |-
        function extractUsernamesAndHashtags(args) {
            // Regex to find usernames
            const usernameRegex = /@\w+(\.\w+)*(_\w+)*(\.\w+)*/g;
            // Regex to find hashtags
            const hashtagRegex = /#\w+/g;

            // Searching for usernames and hashtags in the text from args.input
            const usernames = args.input.match(usernameRegex) || [];
            const hashtags = args.input.match(hashtagRegex) || [];

            // Combining the results into one array
            return [...usernames, ...hashtags];
        }

        return extractUsernamesAndHashtags(args)
      type: js
      param: list
      args: input
      silent: true
      label: FIND NAMES OR HASHTAGS
    - message: '⛔️ Unrecognised #hashtag / @username format.'
      condition: '{{list.length}} = 0'
      type: say
    - type: jump
      to: ASK FOR INPUT
      condition: '{{list.length}} = 0'
    - type: calc
      func: clone
      from: input
      to: g.inst.target
  label: START ASK
  type: group
- steps:
    - steps:
        - param: target
          value: '{{item}}'
          type: calc
          func: set
          format: ''
        - param: saytarget
          type: calc
          func: set
          format: ''
          value: '{{item}}'
        - steps:
            - func: replace
              regex: /^#/gmi
              type: calc
              to: target
              param: target
              template: ''
            - func: encode-url
              type: calc
              to: target
              param: target
            - url: https://www.instagram.com/explore/tags/{{target}}/?hl=en
              type: navigate
              waitForIdle: true
              silent: true
            - to: FIND FOTO URLS
              type: jump
          condition: '{{target}} =~ ^#\w+'
          label: HASHTAG ENTERED
          type: group
        - steps:
            - regex: /^@/gmi
              type: calc
              func: replace
              to: target
              param: target
              template: ''
            - type: calc
              func: encode-url
              to: target
              param: target
            - url: https://www.instagram.com/{{target}}/
              type: navigate
              waitForIdle: true
              silent: true
            - type: jump
              to: FIND FOTO URLS
          condition: '{{target}} =~ ^@\w+'
          label: USERNAME ENTERED
          type: group
        - message: |-
            ⛔️ Unrecognised #hashtag / @username format.
            Skipped.  
          type: say
      label: NAVIGATE
      type: group
    - steps:
        - param: cCount
          type: calc
          func: set
          format: number
          value: '0'
        - code: |-
            await $harpa.scroller.scroll()
            await $harpa.scroller.scroll()
          type: js
          args: ''
          param: ''
          silent: true
        - type: wait
          for: idle
          timeout: 2000
          silent: true
        - type: js
          code: |-
            await $harpa.scroller.scroll()
            await $harpa.scroller.scroll()
          args: ''
          param: ''
          silent: true
        - type: wait
          for: idle
          timeout: 2000
          silent: true
        - code: |-
            return Array
                .from(document.querySelectorAll('a[href*="/p/"]'))
                .map(a => 'https://www.instagram.com' + a.getAttribute('href'))
                .filter(url => url.includes('/p/'));
          param: pageLinks
          type: js
          args: ''
          silent: true
        - code: >-
            let filteredArray = pageLinks.filter(url =>
            !g.inst.processed.includes(url));


            return filteredArray;
          args: pageLinks, g
          param: links
          label: 'FILTERING PROCESSED '
          condition: '{{g.inst.processed}}'
          type: js
          silent: true
        - label: COPY IF 1ST RUN
          type: calc
          func: clone
          from: pageLinks
          to: links
        - message: >-
            🔍 Found {{pageLinks.length}} photos, {{links.length}} are not
            processed yet. Liking....
          condition: '{{links.length}} > 0'
          type: say
        - to: END LOOP SKIP ITEM
          condition: '{{links.length}} = 0'
          type: jump
        - for: 0.5s
          type: wait
          silent: true
      type: group
      label: FIND FOTO URLS
    - label: COUNT ACTIONS
      type: calc
      func: set
      param: likesCount
      format: number
      value: '0'
    - steps:
        - steps:
            - message: >-
                **{{saytarget}}:** {{likesCount}} out of {{g.inst.likesPerRun}}
                photos are liked. 
              type: say
            - to: TO NEXT PAGE
              type: jump
          condition: '{{likesCount}} = {{g.inst.likesPerRun}}'
          label: 'END '
          type: group
        - type: navigate
          url: '{{item}}'
          waitForIdle: false
          silent: true
        - type: control
          action: show
        - for: js-function
          timeout: 3000
          code: >-
            return
            document.querySelectorAll('svg[aria-label="Like"][width="24"],
            svg[aria-label="Unlike"][width="24"]').length > 0
          type: wait
          silent: true
        - code: >-
            return
            document.querySelectorAll('svg[aria-label="Unlike"][width="24"]').length
            > 0
          param: unlike
          type: js
          args: ''
          silent: true
        - message: ❤️ Liking [post]({{item}}) by {{saytarget}}
          condition: '{{saytarget}} =~ ^@\w+'
          type: say
        - message: ❤️ Liking [post]({{item}}) in {{saytarget}}.
          condition: '{{saytarget}} =~ ^#\w+'
          type: say
        - message: 📌 Already liked, skipping!
          condition: '{{unlike}} = true'
          type: say
        - steps:
            - condition: '{{cCount}} ='
              type: calc
              func: set
              param: cCount
              format: number
              value: '0'
            - condition: '{{cCount}} >= {{g.inst.commentsCount}}'
              to: LIKE
              type: jump
            - message: ⏳ Analyzing screenshot
              type: say
            - prompt: >
                Act like you are a regular Instagram user representing the HARPA
                AI Team.


                I want you to analyze a screenshot of a page with a post and
                image, then generage a comment or say that the post should be
                skipped (criteria will be provided later).


                Follow the instructions:

                - Follow my style or instructions: {{g.inst.commentStyle}}. 

                - Response in {{language}}

                - Write very brief answers, act like a regular person, and try
                to use simple words and expressions suitable for social media.

                - Analyze the image and decide if its content is appropriate for
                commenting: consider whether it's reasonable to comment
                according to my instructions. . 

                - Some images are irrelevant and need no comment. If you see an
                irrelevant image in the screenshot, say "skip" in a markdown
                code block.

                - Do not create or assume extra information you haven’t been
                given.

                - I only need the comment in a markdown code block.


                Strictly follow the response format:

                ```markdown

                comment text

                ```


                or for irrelevant content: 


                ```markdown

                skip

                ```


                Instagram page screenshot: {{view}}


                Your response in markdown code block:
              param: reply
              type: gpt
              isolated: true
              silent: false
            - type: calc
              func: extract-code
              to: reply
              param: reply
              index: ''
            - message: >-
                🟡 [Photo]({{url}}) unsuitable for comment based on
                instructions. Skipping.
              condition: '{{reply}} = skip'
              type: say
            - condition: '{{reply}} = skip'
              type: jump
              to: LIKE
            - func: increment
              type: calc
              param: cCount
              delta: 1
            - action: hide
              type: control
            - text: '{{reply}}'
              selector:
                - $matches:
                    - $tag: TEXTAREA
                    - $role: textbox
                    - $class: x1i0vuye
                    - $class: xvbhtw8
                    - $class: x1ejq31n
                    - $class: xd10rxx
                    - $class: x1sy0etr
                    - $class: x17r0tee
                    - $class: x5n08af
                    - $class: x78zum5
                    - $class: x1iyjqo2
                    - $class: x1qlqyl8
                    - $class: x1d6elog
                    - $class: xlk1fp6
                    - $class: x1a2a7pz
                    - $class: xexx8yu
                    - $class: x4uap5
                    - $class: x18d9i69
                    - $class: xkhd6sd
                    - $class: xtt52l0
                    - $class: xnalus7
                    - $class: xs3hnx8
                    - $class: x1bq4at4
                    - $class: xaqnwrm
                    - $attribute: aria-label=Add a comment…
                    - $attribute: autocomplete=off
                    - $attribute: autocorrect=off
                    - $attribute: dir
                    - $attribute: 'style=height: 18px !important;'
                    - $attribute: data-last-active-input
                    - $style: '-apple-system:14px:400:normal'
                    - $placeholder: Add a comment…
                    - $role: form
                      traverse: '0:1'
                    - $class: x1hrcb2b
                      traverse: '0:0:0:1'
                    - $class: x1q2y9iw
                      traverse: '4:0:0:0:1'
                    - $class: x18l3tf1
                      traverse: '4:0:0:0:1'
                    - $class: xy80clv
                      traverse: '4:0:0:0:1'
                    - $anchor: denissluman Beautiful Country 🇳🇴
                      shift: '-10:-32'
                    - traverse: '-12:4:0:0:0:1'
                      $text: denissluman Beautiful Country 🇳🇴
                    - $anchor: ibrgkllrch Heavenly country ❤️
                      shift: '-10:34'
                    - $text: ibrgkllrch Heavenly country ❤️
                      traverse: '-12:4:0:0:0:1'
                    - $anchor: hamza_v8 Love 🇳🇴 🙏🏼
                      shift: '-10:100'
                    - $text: hamza_v8 Love 🇳🇴 🙏🏼
                      traverse: '-12:4:0:0:0:1'
                  min: 12
                - $size: 1
              item:
                container:
                  __$ht: element
                  id: 0
                type: element
                value: Add a comment…
              mode: type
              type: paste
              selectorType: ai
              silent: true
            - selector:
                - $matches:
                    - $tag: DIV
                    - $role: button
                    - $class: x1i10hfl
                    - $class: xjqpnuy
                    - $class: xa49m3k
                    - $class: xqeqjp1
                    - $class: x2hbi6w
                    - $class: xdl72j9
                    - $class: x2lah0s
                    - $class: xe8uvvx
                    - $class: xdj266r
                    - $class: x11i5rnm
                    - $class: xat24cr
                    - $class: x1mh8g0r
                    - $class: x2lwn1j
                    - $class: xeuugli
                    - $class: x1hl2dhg
                    - $class: xggy1nq
                    - $class: x1ja2u2z
                    - $class: x1t137rt
                    - $class: x1q0g3np
                    - $class: x1lku1pv
                    - $class: x1a2a7pz
                    - $class: x6s0dn4
                    - $class: xjyslct
                    - $class: x1ejq31n
                    - $class: xd10rxx
                    - $class: x1sy0etr
                    - $class: x17r0tee
                    - $class: x9f619
                    - $class: x1ypdohk
                    - $class: x1f6kntn
                    - $class: xwhw2v2
                    - $class: xl56j7k
                    - $class: x17ydfre
                    - $class: x2b8uid
                    - $class: xlyipyv
                    - $class: x87ps6o
                    - $class: x14atkfc
                    - $class: xcdnw81
                    - $class: x1i0vuye
                    - $class: xjbqb8w
                    - $class: xm3z3ea
                    - $class: x1x8b98j
                    - $class: x131883w
                    - $class: x16mih1h
                    - $class: x972fbf
                    - $class: xcfux6l
                    - $class: x1qhh985
                    - $class: xm0m39n
                    - $class: xt0psk2
                    - $class: xt7dq6l
                    - $class: xexx8yu
                    - $class: x4uap5
                    - $class: x18d9i69
                    - $class: xkhd6sd
                    - $class: x1n2onr6
                    - $class: x1n5bzlp
                    - $class: x173jzuc
                    - $class: x1yc6y37
                    - $attribute: role=button
                    - $attribute: tabindex=0
                    - $style: '-apple-system:14px:600:normal'
                    - $content: Post
                    - traverse: '0:2:0'
                      $role: form
                    - traverse: '0:0:0:2:0'
                      $class: x1hrcb2b
                    - traverse: '4:0:0:0:2:0'
                      $class: x1q2y9iw
                    - $class: x18l3tf1
                      traverse: '4:0:0:0:2:0'
                    - $class: xy80clv
                      traverse: '4:0:0:0:2:0'
                    - shift: '398:33'
                      $anchor: ibrgkllrch Heavenly country ❤️
                    - traverse: '-12:4:0:0:0:2:0'
                      $text: ibrgkllrch Heavenly country ❤️
                    - shift: 398:-33
                      $anchor: denissluman Beautiful Country 🇳🇴
                    - $text: denissluman Beautiful Country 🇳🇴
                      traverse: '-12:4:0:0:0:2:0'
                    - $anchor: xzczxc
                      shift: 408:-1
                    - traverse: '-1:2:0'
                      $text: xzczxc
                  min: 59
                - $size: 1
              item:
                container:
                  __$ht: element
                  id: 1
                type: element
                value: Post
              type: click
              selectorType: ai
              silent: true
            - message: '✅ Comment sent: **{{cCount}} / {{g.inst.commentsCount}}**'
              type: say
          label: COMMENT
          type: group
          condition: '{{g.inst.comments}} = yes'
        - selector:
            - $matches:
                - $tag: svg
                - $role: img
                - $class: x1lliihq
                - $class: x1n2onr6
                - $class: xyb1xck
                - $attribute: aria-label=Like
                - $attribute: fill=currentColor
                - $attribute: height=24
                - $attribute: role=img
                - $attribute: viewBox=0 0 24 24
                - $attribute: width=24
                - $style: '-apple-system:14px:400:normal'
                - $class: _aamw
                  traverse: '0:0:0:0'
                - $class: _aamu
                  traverse: '0:0:0:0:0'
                - $class: _ae3_
                  traverse: '0:0:0:0:0'
                - $class: _ae47
                  traverse: '0:0:0:0:0'
                - $class: _ae48
                  traverse: '0:0:0:0:0'
                - shift: '-40:-103'
                  $anchor: Add a comment…
                - traverse: '-5:0:0:0:0:0:0'
                  $text: Add a comment…
                - $anchor: >-
                    digi._.fly Chatgpt is a great tool, it can solve all your
                    content creation problem and increase the efficiency 🙌🔥
                  shift: '-50:-209'
                - traverse: '-8:0:0:0:0:0:0'
                  $text: >-
                    digi._.fly Chatgpt is a great tool, it can solve all your
                    content creation problem and increase the efficiency 🙌🔥
                - $anchor: >-
                    _socialdelight These prompts will definitely help you to get
                    your desire results!
                  shift: '-50:-293'
                - $text: >-
                    _socialdelight These prompts will definitely help you to get
                    your desire results!
                  traverse: '-8:0:0:0:0:0:0'
              min: 11
            - $size: 1
          item:
            container:
              __$ht: element
              id: 0
            value: Element
            type: element
          condition: '{{unlike}} = false'
          type: click
          selectorType: ai
          label: LIKE
          silent: false
        - type: calc
          func: increment
          param: likesCount
          delta: 1
          condition: '{{unlike}} = false'
        - func: list-add
          list: g.inst.processed
          item: url
          label: MARK AS PROCESSED
          type: calc
          index: ''
        - condition: '{{g.likesDelay}} = normal'
          label: NORMAL
          for: random-delay
          minDelay: 1000
          maxDelay: 5000
          type: wait
          silent: true
        - maxDelay: 20000
          condition: '{{g.likesDelay}} = slow'
          label: SLOW
          minDelay: 10000
          type: wait
          for: random-delay
          silent: true
        - condition: '{{g.likesDelay}} = fast'
          label: FAST
          type: wait
          for: 0.5s
          silent: true
        - condition: '{{g.likesDelay-option}} = $custom'
          label: CUSTOM DELAY
          for: custom-delay
          type: wait
          silent: true
          delay: 0
        - message: ▶️ Empty page > Next!
          condition: '{{message}} = 🚀 Found 0 photos. Liking them now.'
          type: say
          label: END LOOP SKIP ITEM
      type: loop
      label: LIKES
      list: links
    - type: wait
      for: 0.5s
      label: TO NEXT PAGE
      silent: true
  label: LIKES AND COMMENTS
  type: loop
  list: list
- message: ✅ Done!
  label: ALL DONE
  type: say
Notice: Please read before using

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.

Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service
CAN WE STORE COOKIES?
Our website uses cookies for the purposes of accessibility and security. They also allow us to gather statistics in order to improve the website for you. More info: Privacy Policy