{
  "version": "1.0.0",
  "exported_at": "2026-06-01T10:30:00.000Z",
  "project": {
    "name": "Weibo Post Info Scraper keywords",
    "description": "Extracts Weibo keyword-search post information from m.weibo.cn, including keyword, source URL, username, post time, post URL, content, image URL, video URL, forward/comment/like counts, and extraction time. Navigation uses a keyword URL list plus an infinite-scroll loader that scrolls until content height stabilizes before export. Add more encoded Weibo keyword search URLs to navigate.urls for multi-keyword runs. Best-effort: Weibo may require login, CAPTCHA, or rate-limit handling.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 260,
      "config": {
        "urls": [
          "https://m.weibo.cn/search?containerid=100103type%3D1%26q%3D%E5%BE%AE%E5%8D%9A%E4%B9%8B%E5%A4%9C"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "weibo",
          "keyword-search"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 480,
      "position_y": 260,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "selector": ".card9.weibo-member",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "jsCode": "(async () => {\n  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n  let lastHeight = 0;\n  let stableRounds = 0;\n  let iterations = 0;\n  for (iterations = 0; iterations < 40 && stableRounds < 4; iterations++) {\n    window.scrollTo(0, document.body.scrollHeight);\n    await sleep(1500);\n    const currentHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n    if (currentHeight === lastHeight) {\n      stableRounds += 1;\n    } else {\n      stableRounds = 0;\n      lastHeight = currentHeight;\n    }\n  }\n  window.scrollTo(0, 0);\n  return { iterations, stableRounds, finalHeight: lastHeight, postsLoaded: document.querySelectorAll('.card9.weibo-member').length };\n})();",
        "waitForCompletion": true,
        "timeout": 90,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "duration": 2,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "rowSelector": ".card9.weibo-member",
        "fileName": "weibo-keyword-post-info-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "keyword",
            "selector": "(() => { const href = decodeURIComponent(window.location.href); const m = href.match(/[?&]q=([^&]+)/); return m ? decodeURIComponent(m[1]).replace(/^#|#$/g, '') : document.title; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "username",
            "selector": ".weibo-top h3.m-text-cut",
            "attribute": "text"
          },
          {
            "name": "post_time",
            "selector": ".weibo-top .time",
            "attribute": "text"
          },
          {
            "name": "weibo_url",
            "selector": "(() => { const a = ROW.querySelector('a[href*=\"/status/\"], a[href*=\"video.weibo.com/show\"]'); return a ? new URL(a.getAttribute('href'), location.origin).href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "content",
            "selector": ".weibo-text",
            "attribute": "text"
          },
          {
            "name": "image",
            "selector": "(() => { const img = ROW.querySelector('.weibo-media img, .single-img img, .card-video img'); return img ? img.src : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "video_url",
            "selector": "(() => { const a = ROW.querySelector('a[href*=\"video.weibo.com/show\"]'); return a ? new URL(a.getAttribute('href'), location.origin).href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "forward_count",
            "selector": "(() => { const v = Array.from(ROW.querySelectorAll('.m-ctrl-box .m-diy-btn h4')).map(e => e.textContent.trim()); return v[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_count",
            "selector": "(() => { const v = Array.from(ROW.querySelectorAll('.m-ctrl-box .m-diy-btn h4')).map(e => e.textContent.trim()); return v[1] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "like_count",
            "selector": "(() => { const v = Array.from(ROW.querySelectorAll('.m-ctrl-box .m-diy-btn h4')).map(e => e.textContent.trim()); return v[2] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_time",
            "selector": "new Date().toISOString()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2640,
      "position_y": 260,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "connections": [
    {
      "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "loop-continue-1",
      "from_connector_id": "right",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 156,
      "width": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1128,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 2208,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2568,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Extracts Weibo keyword-search post information from m.weibo.cn, including keyword, source URL, username, post time, post URL, content, image URL, video URL, forward/comment/like counts, and extraction time. Navigation uses a keyword URL list plus an infinite-scroll loader that scrolls until content height stabilizes before export. Add more encoded Weibo keyword search URLs to navigate.urls for multi-keyword runs. Best-effort: Weibo may require login, CAPTCHA, or rate-limit handling.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(async () => {\n  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n  let last...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1400,
      "position_y": 240,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (keyword, url, weibo_url, image, video_url). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 240,
      "width": 340,
      "height": 127,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-loop-continue-1",
      "element_type": "note",
      "title": "Note: Loop Continue",
      "content": "Loop Continue advances a multi-URL or multi-text loop. Place at the end of the loop body with a clear back-edge to the loop start.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}