{
  "version": "1.0.0",
  "exported_at": "2026-05-31T07:30:00.000Z",
  "project": {
    "name": "Get Twitter Cookies",
    "description": "Logs in to X/Twitter from https://x.com/search-advanced using editable username/password placeholders, then exports JavaScript-accessible cookies to get-twitter-cookies.csv. Pagination is not applicable because this template extracts a single authenticated session cookie record, not a multi-page listing. Limitations: X may require verification, 2FA, CAPTCHA, or use HTTPOnly cookies that document.cookie cannot export.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser viewport size",
      "position_x": 120,
      "position_y": 240,
      "config": {
        "width": 1366,
        "height": 900,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 480,
      "position_y": 240,
      "config": {
        "url": "https://x.com/search-advanced",
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 840,
      "position_y": 240,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "selector": "input#jf-input-username_or_email, input[name=\"username_or_email\"], input[autocomplete*=\"username\"]"
      }
    },
    {
      "block_id": "type-text-1",
      "block_type": "process",
      "title": "Type Text",
      "description": "Type text into an input field",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "selector": "input#jf-input-username_or_email, input[name=\"username_or_email\"], input[autocomplete*=\"username\"]",
        "text": "REPLACE_WITH_X_USERNAME",
        "clearFirst": true
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "selector": "(//*[self::button or self::div or @role=\"button\"][.//*[normalize-space()=\"Continue\"] or normalize-space()=\"Continue\"])[1]",
        "timeout": 15
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 2640,
      "position_y": 240,
      "config": {
        "selector": "input[name=\"password\"]:not([aria-hidden=\"true\"])",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "type-text-2",
      "block_type": "process",
      "title": "Type Text",
      "description": "Type text into an input field",
      "position_x": 3000,
      "position_y": 240,
      "config": {
        "selector": "input[name=\"password\"]:not([aria-hidden=\"true\"])",
        "text": "REPLACE_WITH_X_PASSWORD",
        "clearFirst": true
      }
    },
    {
      "block_id": "click-2",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 3360,
      "position_y": 240,
      "config": {
        "selector": "(//*[@data-testid=\"LoginForm_Login_Button\" or self::button or self::div or @role=\"button\"][.//*[normalize-space()=\"Log in\"] or .//*[normalize-space()=\"Login\"] or normalize-space()=\"Log in\" or normalize-space()=\"Login\"])[1]",
        "timeout": 20
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3720,
      "position_y": 240,
      "config": {
        "duration": 8
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 4080,
      "position_y": 240,
      "config": {
        "selector": "body",
        "timeout": 20,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 4440,
      "position_y": 240,
      "config": {
        "rowSelector": "body",
        "fileName": "get-twitter-cookies.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "create",
        "columns": [
          {
            "name": "extracted_at",
            "selector": "new Date().toISOString()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_url",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "login_state",
            "selector": "document.body.innerText.includes('Happening now.') || document.body.innerText.includes('Email or username') ? 'login_required_or_failed' : 'possibly_logged_in'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "cookie_string",
            "selector": "document.cookie || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "cookie_count",
            "selector": "String((document.cookie || '').split(';').filter(Boolean).length)",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 4800,
      "position_y": 240,
      "config": {}
    },
    {
      "block_id": "wait-for-element-3",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 600,
      "config": {
        "selector": "body",
        "timeout": 20,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-2",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 600,
      "config": {
        "rowSelector": "body",
        "fileName": "get-twitter-cookies.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "create",
        "columns": [
          {
            "name": "extracted_at",
            "selector": "new Date().toISOString()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_url",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "login_state",
            "selector": "document.body.innerText.includes('Happening now.') || document.body.innerText.includes('Email or username') ? 'login_required_or_failed' : 'possibly_logged_in'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "cookie_string",
            "selector": "document.cookie || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "cookie_count",
            "selector": "String((document.cookie || '').split(';').filter(Boolean).length)",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "end-2",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2280,
      "position_y": 600,
      "config": {}
    }
  ],
  "connections": [
    {
      "from_block_id": "set-window-size-1",
      "from_connector_id": "right",
      "to_block_id": "navigate-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "navigate-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-1",
      "from_connector_id": "right",
      "to_block_id": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-1",
      "from_connector_id": "right",
      "to_block_id": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "type-text-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "wait-for-element-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "type-text-1",
      "from_connector_id": "right",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "type-text-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "type-text-2",
      "from_connector_id": "right",
      "to_block_id": "click-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-2",
      "from_connector_id": "right",
      "to_block_id": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-2",
      "from_connector_id": "right",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-3",
      "from_connector_id": "right",
      "to_block_id": "structured-export-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-2",
      "from_connector_id": "right",
      "to_block_id": "end-2",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "set-window-size-1"
        ]
      }
    },
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 408,
      "position_y": 136,
      "width": 3920,
      "height": 656,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "sleep-2",
          "wait-for-element-2",
          "wait-for-element-3"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1488,
      "position_y": 136,
      "width": 2120,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "click-2"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1848,
      "position_y": 136,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "type-text-1",
          "type-text-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 136,
      "width": 2840,
      "height": 656,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1",
          "structured-export-2"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2208,
      "position_y": 136,
      "width": 2840,
      "height": 656,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1",
          "end-2"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Logs in to X/Twitter from https://x.com/search-advanced using editable username/password placeholders, then exports JavaScript-accessible cookies to get-twitter-cookies.csv. Pagination is not applicable because this template extracts a single authenticated session cookie record, not a multi-page listing. Limitations: X may require verification, 2FA, CAPTCHA, or use HTTPOnly cookies that document.cookie cannot export.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `input#jf-input-username_or_email, input[name=\"username_or_email\"], input[autocomplete*=\"username\"]`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 220,
      "width": 340,
      "height": 163,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-click-1",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Uses XPath `(//*[self::button or self::div or @role=\"button\"][.//*[normalize-space()=\"Continue\"] or normalize-sp`. XPath breaks easily if DOM structure changes.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 220,
      "width": 340,
      "height": 133,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    },
    {
      "id": "note-block-click-2",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Uses XPath `(//*[@data-testid=\"LoginForm_Login_Button\" or self::button or self::div or @role=\"button\"][.//*[norm`. XPath breaks easily if DOM structure changes.",
      "color": "#ee5396",
      "position_x": 3560,
      "position_y": 220,
      "width": 340,
      "height": 133,
      "z_index": 22,
      "data": {
        "block_id": "click-2"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (extracted_at, current_url, login_state, cookie_string, cookie_count). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 4640,
      "position_y": 220,
      "width": 340,
      "height": 136,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-structured-export-2",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (extracted_at, current_url, login_state, cookie_string, cookie_count). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 580,
      "width": 340,
      "height": 136,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-2"
      }
    }
  ]
}