{"_id":"@cachis/x-crawler","_rev":"4-eac3bf574a4f0300b8210863c81bfdb8","name":"@cachis/x-crawler","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@cachis/x-crawler","version":"1.0.0","keywords":["twitter","crawler","scraper","x.com","tweets","twitter-api","web-scraping","automation"],"author":{"name":"Marcos Camacho","email":"marcoscachis@gmail.com"},"license":"MIT","_id":"@cachis/x-crawler@1.0.0","maintainers":[{"name":"cachis","email":"marcoscachis@gmail.com"}],"homepage":"https://github.com/Cachiss/x-crawler#readme","bugs":{"url":"https://github.com/Cachiss/x-crawler/issues"},"dist":{"shasum":"20cc9901ebe792b3f19b4c69d74034a004c7e677","tarball":"https://registry.npmjs.org/@cachis/x-crawler/-/x-crawler-1.0.0.tgz","fileCount":50,"integrity":"sha512-evd0RPFchU0/K1jGdvHP5oL1QLlCsasSB9z6CFfmwdHbCuvh+FuppUDVmQpkVrdOyJnWgsbAAW+Wozj9t6lsAw==","signatures":[{"sig":"MEUCIQDK1kJB7e/2THR5BGHIWpFfuxQfh2EUgGDhqKIqQdZzeQIgZRnU/YlqXtP14RYfHE6ACGS161V8AEUyzZ8+TE2qSVw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":142605},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"cce1ab9982e6fc0be3eca27036404ec1fbe930e8","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cachis","email":"marcoscachis@gmail.com"},"repository":{"url":"git+https://github.com/Cachiss/x-crawler.git","type":"git"},"_npmVersion":"10.2.4","description":"Librería para crawlear tweets y respuestas de Twitter/X","directories":{},"_nodeVersion":"21.4.0","dependencies":{"chalk":"^4.1.2","@playwright/test":"^1.41.1","playwright-extra":"^4.3.6","puppeteer-extra-plugin-stealth":"^2.11.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.0.0"},"peerDependencies":{"playwright":"^1.54.1"},"_npmOperationalInternal":{"tmp":"tmp/x-crawler_1.0.0_1762800382845_0.3061935407431393","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@cachis/x-crawler","version":"1.0.1","keywords":["twitter","crawler","scraper","x.com","tweets","twitter-api","web-scraping","automation"],"author":{"name":"Marcos Camacho","email":"marcoscachis@gmail.com"},"license":"MIT","_id":"@cachis/x-crawler@1.0.1","maintainers":[{"name":"cachis","email":"marcoscachis@gmail.com"}],"homepage":"https://github.com/Cachiss/x-crawler#readme","bugs":{"url":"https://github.com/Cachiss/x-crawler/issues"},"dist":{"shasum":"5cbd7c7dc245ed6d0b62c2383623bf67116194a5","tarball":"https://registry.npmjs.org/@cachis/x-crawler/-/x-crawler-1.0.1.tgz","fileCount":50,"integrity":"sha512-dIxHwfHns0K9XBc1R7GdaX7wUnqbK3fd3GA23BFqR7HO2hdzFaa1p8Mf63gGU1mNMo0ETvIzTqyLu6/ANwJ+rw==","signatures":[{"sig":"MEUCIC7iAx2W1/ATDC5EaS01veYFyuR+qV/gjoV5XNv9GrCqAiEAj5O5wjiEY+sz/QPEzw1+s/jF6GKLZaWUKCvgLKqP+vM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":158554},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"3cdcfb7c6b794cdf42644aaea43040ca551f2b57","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cachis","email":"marcoscachis@gmail.com"},"repository":{"url":"git+https://github.com/Cachiss/x-crawler.git","type":"git"},"_npmVersion":"10.2.4","description":"Librería para crawlear tweets y respuestas de Twitter/X","directories":{},"_nodeVersion":"21.4.0","dependencies":{"chalk":"^4.1.2","@playwright/test":"^1.41.1","playwright-extra":"^4.3.6","puppeteer-extra-plugin-stealth":"^2.11.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.0.0"},"peerDependencies":{"playwright":"^1.54.1"},"_npmOperationalInternal":{"tmp":"tmp/x-crawler_1.0.1_1764793291532_0.79755220133151","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@cachis/x-crawler","version":"1.0.2","keywords":["twitter","crawler","scraper","x.com","tweets","twitter-api","web-scraping","automation"],"author":{"name":"Marcos Camacho","email":"marcoscachis@gmail.com"},"license":"MIT","_id":"@cachis/x-crawler@1.0.2","maintainers":[{"name":"cachis","email":"marcoscachis@gmail.com"}],"homepage":"https://github.com/Cachiss/x-crawler#readme","bugs":{"url":"https://github.com/Cachiss/x-crawler/issues"},"dist":{"shasum":"e1e4e8e50d96686bd33890acb0b3d662f18bd143","tarball":"https://registry.npmjs.org/@cachis/x-crawler/-/x-crawler-1.0.2.tgz","fileCount":50,"integrity":"sha512-pMFmcGFyk3jEiCHX4/ta85fBRQy/ARuT344onC6uvOIkfMVpZpVl0yannNiiTxybSgnI9gP+wllJB0QJzNAx4Q==","signatures":[{"sig":"MEYCIQCHFO1vzThVW5VkhVFg1apwggXM0VU1+dPZIjUzWxaVQwIhAMXSZtaTWbDR1qF/1MDKmOvQQuCSf065ecPINsXns9RG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":168750},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"f59ca9e9b5c13a8739646ece5b91e7f6053a36a8","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cachis","email":"marcoscachis@gmail.com"},"repository":{"url":"git+https://github.com/Cachiss/x-crawler.git","type":"git"},"_npmVersion":"10.2.4","description":"Librería para crawlear tweets y respuestas de Twitter/X","directories":{},"_nodeVersion":"21.4.0","dependencies":{"chalk":"^4.1.2","@playwright/test":"^1.41.1","playwright-extra":"^4.3.6","puppeteer-extra-plugin-stealth":"^2.11.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.0.0"},"peerDependencies":{"playwright":"^1.54.1"},"_npmOperationalInternal":{"tmp":"tmp/x-crawler_1.0.2_1764795994948_0.08209658693842603","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@cachis/x-crawler","version":"1.0.3","description":"Librería para crawlear tweets y respuestas de Twitter/X","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["twitter","crawler","scraper","x.com","tweets","twitter-api","web-scraping","automation"],"author":{"name":"Marcos Camacho","email":"marcoscachis@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/Cachiss/x-crawler.git"},"license":"MIT","engines":{"node":">=18.0.0"},"dependencies":{"@playwright/test":"^1.41.1","chalk":"^4.1.2","playwright-extra":"^4.3.6","puppeteer-extra-plugin-stealth":"^2.11.2"},"devDependencies":{"@types/node":"^20.0.0","typescript":"^5.3.3"},"peerDependencies":{"playwright":"^1.54.1"},"_id":"@cachis/x-crawler@1.0.3","gitHead":"b739207a063b64e46d55a2b3f12c5a09413c8f13","bugs":{"url":"https://github.com/Cachiss/x-crawler/issues"},"homepage":"https://github.com/Cachiss/x-crawler#readme","_nodeVersion":"21.4.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-WJWgQ2XOZVXqT1SmuaJM43q/apvzvOofXjCEl6vrHQrG41hvC+HcJidEeIqyGYUf/wBRnRNEVoYBDauxyKKb3A==","shasum":"31843b2b7779d0564efd871af9431d43a883614f","tarball":"https://registry.npmjs.org/@cachis/x-crawler/-/x-crawler-1.0.3.tgz","fileCount":50,"unpackedSize":168750,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD/VH7/OebBfbA7iDutjohIKpC3BLzh/B06tT7C7mGoCwIhAPnLFoQG4HLGDykkyr9tjspnQ/ryZYzzXFSltFJWvVUN"}]},"_npmUser":{"name":"cachis","email":"marcoscachis@gmail.com"},"directories":{},"maintainers":[{"name":"cachis","email":"marcoscachis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x-crawler_1.0.3_1764796128224_0.3401370097234233"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-10T18:46:22.721Z","modified":"2025-12-03T21:08:48.577Z","1.0.0":"2025-11-10T18:46:23.026Z","1.0.1":"2025-12-03T20:21:31.700Z","1.0.2":"2025-12-03T21:06:35.143Z","1.0.3":"2025-12-03T21:08:48.397Z"},"bugs":{"url":"https://github.com/Cachiss/x-crawler/issues"},"author":{"name":"Marcos Camacho","email":"marcoscachis@gmail.com"},"license":"MIT","homepage":"https://github.com/Cachiss/x-crawler#readme","keywords":["twitter","crawler","scraper","x.com","tweets","twitter-api","web-scraping","automation"],"repository":{"type":"git","url":"git+https://github.com/Cachiss/x-crawler.git"},"description":"Librería para crawlear tweets y respuestas de Twitter/X","maintainers":[{"name":"cachis","email":"marcoscachis@gmail.com"}],"readme":"# Twitter Crawler Library\n\nLibrería para crawlear tweets y respuestas de Twitter/X con autenticación.\n\n## Instalación\n\n```bash\nnpm install @cachis/x-crawler\n```\n\nO con yarn:\n\n```bash\nyarn add @cachis/x-crawler\n```\n\n**Nota:** Esta librería requiere Playwright como dependencia peer. Asegúrate de instalarlo:\n\n```bash\nnpm install playwright\n```\n\n## Uso\n\n### Inicialización\n\n```typescript\nimport { TwitterCrawler } from '@cachis/x-crawler';\n\n// Inicializar con token de autenticación (requerido)\nconst crawler = TwitterCrawler.init({\n  authToken: 'tu_token_aqui',\n  configType: 'default' // opcional: 'default' | 'aggressive' | 'conservative'\n});\n```\n\n### Crawlear Tweets\n\n```typescript\n// Búsqueda por palabras clave\nconst tweets = await crawler.crawlTweets({\n  searchKeywords: 'palabra clave',\n  targetCount: 100,\n  searchTab: 'LATEST', // 'LATEST' | 'TOP'\n  searchFromDate: '2024-01-01',\n  searchToDate: '2024-12-31',\n  onLog: (message) => console.log(message),\n  onProgress: (progress) => console.log(`Tweets recolectados: ${progress.collectedTweets}`)\n});\n\n// Búsqueda por usuarios\nconst userTweets = await crawler.crawlTweets({\n  searchUsernames: ['usuario1', 'usuario2'],\n  targetCount: 50\n});\n\n// Crawlear hilo de tweet\nconst threadTweets = await crawler.crawlTweets({\n  tweetThreadUrl: 'https://x.com/usuario/status/1234567890',\n  targetCount: -1 // -1 para sin límite\n});\n```\n\n### Crawlear Respuestas\n\n```typescript\n// Respuestas de un tweet\nconst replies = await crawler.crawlReplies({\n  tweetUrl: 'https://x.com/usuario/status/1234567890',\n  idTweet: 1, // opcional\n  maxReplies: 50, // -1 para sin límite\n  onLog: (message) => console.log(message)\n});\n\n// Respuestas de múltiples tweets\nconst results = await crawler.crawlMultipleReplies({\n  tweets: [\n    { id: 1, tweet_url: 'https://x.com/usuario/status/1234567890', usuario_twitter: 'usuario' },\n    { id: 2, tweet_url: 'https://x.com/usuario/status/0987654321', usuario_twitter: 'usuario' }\n  ],\n  maxReplies: 50,\n  onLog: (message) => console.log(message)\n});\n```\n\n### Obtener Métricas de un Tweet\n\n```typescript\n// Obtener métricas de un tweet específico\nconst metrics = await crawler.getTweetMetrics({\n  tweetUrl: 'https://x.com/lopezdoriga/status/1995893221839245382',\n  onLog: (message) => console.log(message)\n});\n\nif (metrics) {\n  console.log(`ID: ${metrics.id_str}`);\n  console.log(`Username: @${metrics.username}`);\n  console.log(`Text: ${metrics.full_text}`);\n  console.log(`Views: ${metrics.views}`);\n  console.log(`Replies: ${metrics.reply_count}`);\n  console.log(`Retweets: ${metrics.retweet_count}`);\n  console.log(`Quotes: ${metrics.quote_count}`);\n  console.log(`Likes: ${metrics.favorite_count}`);\n}\n```\n\n## Configuración\n\nLa librería soporta tres tipos de configuración:\n\n- **default**: Equilibrio entre velocidad y estabilidad\n- **aggressive**: Más rápido, ideal para cuentas con buenos límites\n- **conservative**: Más lento pero muy estable, ideal para cuentas con límites bajos\n\n```typescript\nconst crawler = TwitterCrawler.init({\n  authToken: 'tu_token',\n  configType: 'aggressive'\n});\n\n// O cambiar la configuración después\ncrawler.setConfigType('conservative');\n```\n\n## Tipos\n\n```typescript\nimport { TweetHash, TweetAnswer, CrawlRepliesResult } from '@cachis/x-crawler';\n```\n\n## Notas\n\n- La librería requiere un token de autenticación válido de Twitter/X\n- El token debe ser inyectado como cookie `auth_token`\n- La librería usa Playwright para automatizar el navegador\n- Se recomienda usar rotación de tokens para evitar rate limits\n\n","readmeFilename":"README.md"}