tweespaces
Advanced tools
Comparing version 0.0.20 to 0.0.21
{ | ||
"name": "tweespaces", | ||
"description": "Lookup Twitter spaces by keyword", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"license": "MIT", | ||
@@ -42,4 +42,2 @@ "bin": { | ||
"cli-welcome": "^2.2.2", | ||
"cross-env": "^7.0.3", | ||
"crypto-js": "^4.1.1", | ||
"dotenv": "^10.0.0", | ||
@@ -49,3 +47,2 @@ "lodash.merge": "^4.6.2", | ||
"node-emoji": "^1.11.0", | ||
"node-env-run": "^4.0.2", | ||
"node-fetch": "^2.6.1" | ||
@@ -52,0 +49,0 @@ }, |
@@ -7,6 +7,3 @@ require('dotenv').config(); | ||
const emoji = require('node-emoji') | ||
const CryptoJS = require("crypto-js"); | ||
const SPACES_URL = 'https://api.twitter.com/2/spaces/search?query='; | ||
module.exports = async ({ | ||
@@ -18,28 +15,10 @@ scheduled, | ||
const bearer = await fetch('https://tweespaces-serverless-function.vercel.app/api/bearer'); | ||
const bearerResult = await bearer.json(); | ||
const state = scheduled ? 'scheduled' : live ? 'live' : 'live' | ||
const response = await fetch(`https://tweespaces-serverless-function.vercel.app/api/spaces?state=${state}`); | ||
const result = await response.json(); | ||
const url = `${SPACES_URL}${query}&state=${state}&space.fields=participant_count,scheduled_start,title&expansions=creator_id&user.fields=name,description,username`; | ||
const spinner = new Spinner(dim('Searching for spaces.....')); | ||
const spinner = new Spinner('Searching for spaces....'); | ||
spinner.start(); | ||
spinner.start(dim('Searching for spaces.....')); | ||
const decryptWithAES = (stringToDecrypt) => { | ||
const bytes = CryptoJS.AES.decrypt(stringToDecrypt, 'Magpienemo@011210'); | ||
const originalText = bytes.toString(CryptoJS.enc.Utf8); | ||
return originalText; | ||
}; | ||
const response = await fetch(url, { | ||
method: 'GET', | ||
headers: { | ||
'Authorization': 'Bearer ' + decryptWithAES(bearerResult.bearer), | ||
'Content-Type': 'application/json' | ||
}, | ||
}); | ||
const result = await response.json(); | ||
const hasResult = result.meta.result_count !== 0 ? true : false; | ||
@@ -46,0 +25,0 @@ |
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
12
1
6773
179
- Removedcross-env@^7.0.3
- Removedcrypto-js@^4.1.1
- Removednode-env-run@^4.0.2
- Removed@types/common-tags@1.8.4(transitive)
- Removed@types/debug@4.1.12(transitive)
- Removed@types/ms@0.7.34(transitive)
- Removed@types/node@10.17.60(transitive)
- Removed@types/yargs@15.0.19(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedcliui@6.0.0(transitive)
- Removedcommon-tags@1.8.2(transitive)
- Removedcross-env@7.0.3(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removedcrypto-js@4.2.0(transitive)
- Removeddebug@4.3.7(transitive)
- Removeddotenv@8.6.0(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedisexe@2.0.0(transitive)
- Removedms@2.1.3(transitive)
- Removednode-env-run@4.0.2(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedpkginfo@0.4.1(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedrequire-main-filename@2.0.0(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedupath@1.2.0(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwhich-module@2.0.1(transitive)
- Removedwrap-ansi@6.2.0(transitive)
- Removedy18n@4.0.3(transitive)
- Removedyargs@15.4.1(transitive)
- Removedyargs-parser@18.1.3(transitive)