HARPA.AI
LIBRARYAPIGUIDESAI COMMANDSBLOG

📦  Database Enrichment

Works with your existing customer or lead database that has business email addresses. It analyzes domain data to enrich your database with additional information about your customers' businesses. #make #grid

Created by HARPA AI
Updated on Dec 30, 2024 20:36
Installed 125 times
RUNS JS CODE

How to Use

IMPORT COMMAND

Content

- type: ask
  param: input
  message: Send me a link, email, or start searching for data within a current webpage.
  options:
    - label: ✅ USE WEBPAGE
      value: start
    - $custom
  default: ''
  vision:
    enabled: false
    mode: area
    hint: ''
    send: true
  optionsInvalid: false
- type: group
  steps:
    - type: js
      args: input
      code: |-
        function extractDomain(input) {
            let domain;
            
            // Check if the input is a valid URL
            try {
                const url = new URL(input);
                domain = url.hostname; // Extract domain from URL
            } catch (e) {
                // If input is not a URL, assume it's an email
                const emailParts = input.split('@');
                if (emailParts.length > 1) {
                    domain = emailParts[1]; // Extract domain from email
                } else {
                    domain = null; // Not a valid URL or email
                }
            }
            
            return domain;
        }

        return extractDomain(input);
      param: link
      timeout: 15000
      onFailure: ''
      silent: true
    - type: navigate
      url: '{{link}}'
      waitForIdle: true
      silent: false
      onFailure: ''
  label: EXTRACT DOMAIN
  condition: '{{input}} != start'
- prompt: >-
    You are a Data Research AI Agent.

    Your task is to extract data from a web page and respond with JSON as
    requested.


    Follow these instructions:

    - Analyze the web page and all the information needed to fill the requested
    JSON fields:


    ```

    {
      "website": "{{url}}",
      "name": "official business name",
      "description": "Detailed description of the products or services offered by the business.",
      "location": "Company address or any known location details, e.g.: country",
      "phone": "Phone number if found on the page", 
      "extraEmail": "Email address if found on the page, or 'Contact Form' if a contact form is present"
    }

    ```


    - If I haven't described criteria for determining the information for
    corresponding fields, decide this independently based on your judgment.

    - Respond in {{language}}.

    - Be concise and to the point.

    - Respond with a JSON, write nothing more.

    - Wrap your JSON response in a code block.



    Webpage URL: {{url}}


    Webpage Data: {{page}}


    Webpage Description: {{description}}


    JSON response:
  type: gpt
  param: json
  isolated: true
- type: calc
  func: extract-json
  to: json
  param: json
  index: ''
- message: |-
    The result is saved in the "**json**" parameter:

    {{json}}
  type: say
  interpolate: true
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