twitter-puppeteer
Advanced tools
Comparing version 0.0.5 to 0.0.6
58
index.js
#!/usr/bin/env node | ||
const yargs = require("yargs"); | ||
const user = require('./user'); | ||
const search = require('./search'); | ||
const user = require("./user"); | ||
const search = require("./search"); | ||
!(async() => { | ||
const command_type = process.argv[2]; | ||
const command_args = process.argv[3]; | ||
switch (command_type) { | ||
case 'profile': | ||
const profile = await user.getProfile(command_args); | ||
console.log(profile); | ||
break | ||
case 'timeline': | ||
const timeline = await user.getTimeline(command_args); | ||
console.log(timeline); | ||
break; | ||
case 'search': | ||
const searchResult = await search.getSearchResult(command_args); | ||
console.log(searchResult); | ||
break; | ||
default: | ||
break; | ||
} | ||
})(); | ||
yargs | ||
.scriptName("twitter-puppeteer") | ||
.usage("$0 <cmd> [args]") | ||
.command( | ||
"profile [USER NAME]", | ||
"Download Profile", | ||
(yargs) => {}, | ||
async (argv) => { | ||
const { username } = argv; | ||
const profile = await user.getProfile(username); | ||
console.log(JSON.stringify(profile)); | ||
} | ||
) | ||
.command( | ||
"timeline [USER NAME]", | ||
"Download Timeline", | ||
(yargs) => {}, | ||
async (argv) => { | ||
const { username } = argv; | ||
const timeline = await user.getTimeline(username); | ||
console.log(JSON.stringify(timeline)); | ||
} | ||
) | ||
.command( | ||
"search [QUERY]", | ||
"Search Twitter", | ||
(yargs) => {}, | ||
async (argv) => { | ||
const { query } = argv; | ||
const searchResult = await search.getSearchResult(query); | ||
console.log(JSON.stringify(searchResult)); | ||
} | ||
).argv; |
{ | ||
"name": "twitter-puppeteer", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "download all twitter data by scraping without api token using puppeteer.", | ||
@@ -28,3 +28,4 @@ "main": "index.js", | ||
"request": "^2.88.2", | ||
"request-promise": "^4.2.6" | ||
"request-promise": "^4.2.6", | ||
"yargs": "^15.4.1" | ||
}, | ||
@@ -31,0 +32,0 @@ "devDependencies": { |
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
12436
306
6
+ Addedyargs@^15.4.1
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedcamelcase@5.3.1(transitive)
+ Addedcliui@6.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequire-main-filename@2.0.0(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedwrap-ansi@6.2.0(transitive)
+ Addedy18n@4.0.3(transitive)
+ Addedyargs@15.4.1(transitive)
+ Addedyargs-parser@18.1.3(transitive)