tweespaces
Advanced tools
Comparing version 0.0.29 to 0.0.30
@@ -24,4 +24,4 @@ #!/usr/bin/env node | ||
if (flags.username) { | ||
await findSpaceByHost({ username: flags.username }) | ||
if (flags.host) { | ||
await findSpaceByHost({ username: flags.host }) | ||
} | ||
@@ -28,0 +28,0 @@ |
{ | ||
"name": "tweespaces", | ||
"description": "Lookup Twitter spaces by keyword", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -17,8 +17,10 @@ | ||
There are 3 flags: | ||
There are 4 flags: | ||
- `--live` - all spaces that are live now and match the query. | ||
- `--scheduled` - all spaces that are scheduled to be run and match the query. | ||
- `--query=""` - the keyword to query. This can be any text (including mentions and Hashtags). | ||
- `--live` - `--l` - all spaces that are live now and match the query. | ||
- `--scheduled` - `--s` - all spaces that are scheduled to be run and match the query. | ||
- `--query=""` - `--q=""` - the keyword to query. This can be any text (including mentions and Hashtags). | ||
- `--host=""` - `--h=""` - all spaces that have been shceduled by the given host. This is someones twitter handle. For example `--host="studio_hungry"` | ||
### Show all live spaces with "developer" in the title | ||
@@ -36,2 +38,8 @@ | ||
### Show all scheduled spaces from the user "studio_hungry" | ||
```bash | ||
npx tweespaces --host="studio_hungry" | ||
``` | ||
## Result | ||
@@ -38,0 +46,0 @@ |
@@ -29,2 +29,3 @@ const meow = require('meow'); | ||
type: `boolean`, | ||
alias: `l`, | ||
default: false, | ||
@@ -35,2 +36,3 @@ desc: `Spaces live now` | ||
type: `boolean`, | ||
alias: `s`, | ||
default: false, | ||
@@ -41,2 +43,3 @@ desc: `Spaces scheduled for later` | ||
type: `string`, | ||
alias: `q`, | ||
desc: `Search query` | ||
@@ -46,2 +49,3 @@ }, | ||
type: `string`, | ||
alias: `h`, | ||
desc: `The host of the space` | ||
@@ -48,0 +52,0 @@ } |
@@ -8,3 +8,2 @@ const { dim, italic, bold, red, green } = require('chalk'); | ||
module.exports = async ({ username }) => { | ||
const userResponse = await axios.post( | ||
@@ -22,4 +21,2 @@ `https://tweespaces-serverless-function.vercel.app/api/space-by-user`, | ||
// console.log(userResponse.data) | ||
const data = userResponse.data.spaces.data; | ||
@@ -38,10 +35,9 @@ const meta = userResponse.data.spaces.meta; | ||
if (!hasResult) { | ||
return console.log(emoji.get('scream'), ' ', bold('No results found!')); | ||
return console.log(emoji.get('scream'), ' ', bold(`This person hasn't scheduled any Twitter spaces yet.`)); | ||
} | ||
const spaceInfo = data.map( | ||
({ participant_count, scheduled_start, title, creator_id }) => { | ||
({ scheduled_start, title, creator_id }) => { | ||
return { | ||
creator_id, | ||
participants: participant_count, | ||
start: scheduled_start, | ||
@@ -69,15 +65,9 @@ title | ||
} | ||
space.map(({ title, creator, creatorHandle, start, description }) => { | ||
const timingCheck = () => { | ||
if (start === undefined) { | ||
return console.log( | ||
emoji.get('timer_clock'), | ||
' ', | ||
bold('Live now!') | ||
); | ||
} | ||
const scheduledFor = () => { | ||
return console.log( | ||
emoji.get('timer_clock'), | ||
' ', | ||
bold('Time: ', new Date(start).toLocaleTimeString('en-US')), | ||
bold('Sheduled for: ', new Date(start).toLocaleTimeString('en-US')), | ||
dim(italic(' (All times localized)')), | ||
@@ -112,3 +102,3 @@ emoji.get('sunglasses') | ||
console.log(); | ||
timingCheck(); | ||
scheduledFor(); | ||
console.log( | ||
@@ -115,0 +105,0 @@ green( |
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
12297
52
372