@the-convocation/twitter-scraper
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -76,2 +76,8 @@ "use strict"; | ||
} | ||
if (!value.data || !value.data.user || !value.data.user.result) { | ||
return { | ||
success: false, | ||
err: new Error('User not found.'), | ||
}; | ||
} | ||
const { result: user } = value.data.user; | ||
@@ -78,0 +84,0 @@ const { legacy } = user; |
@@ -7,18 +7,23 @@ "use strict"; | ||
let cursor = undefined; | ||
let consecutiveEmptyBatches = 0; | ||
while (nProfiles < maxProfiles) { | ||
const batch = await fetchFunc(query, maxProfiles, cursor); | ||
const { profiles, next } = batch; | ||
cursor = next; | ||
if (profiles.length === 0) { | ||
break; | ||
consecutiveEmptyBatches++; | ||
if (consecutiveEmptyBatches > 5) | ||
break; | ||
} | ||
else | ||
consecutiveEmptyBatches = 0; | ||
for (const profile of profiles) { | ||
if (nProfiles < maxProfiles) { | ||
cursor = next; | ||
if (nProfiles < maxProfiles) | ||
yield profile; | ||
} | ||
else { | ||
else | ||
break; | ||
} | ||
nProfiles++; | ||
} | ||
if (!next) | ||
break; | ||
} | ||
@@ -25,0 +30,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["x", "twitter", "scraper"], | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"main": "dist/_module.js", | ||
@@ -8,0 +8,0 @@ "repository": "https://github.com/the-convocation/twitter-scraper.git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential security risk
Supply chain riskAI has determined that this package may contain potential security issues or vulnerabilities.
Found 1 instance in 1 package
242201
3338
0