Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const LookupsClient = require('twilio').LookupsClient;
const client = new LookupsClient(accountSid, authToken);
client.phoneNumbers('(510) 867-5309').get({
countryCode: 'US',
type: 'carrier'
}, function(error, number) {
console.log(number.carrier.type);
console.log(number.carrier.name);
});
// Download the Node helper library from twilio.com/docs/library/node
var LookupsClient = require('twilio').LookupsClient;
// These vars are your Account Sid and Auth Token from twilio.com/console
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var client = new LookupsClient(accountSid, authToken);
client.phoneNumbers('(510) 867-5309').get({
countryCode: 'US'
}, function(error, number) {
console.log(number.phoneNumber);
});
// Download the Node helper library from twilio.com/docs/library/node
var LookupsClient = require('twilio').LookupsClient;
// These vars are your Account Sid and Auth Token from twilio.com/console
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var client = new LookupsClient(accountSid, authToken);
client.phoneNumbers('+4402077651182').get(function(error, number) {
console.log(number.nationalFormat);
});
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var LookupsClient = require('twilio').LookupsClient;
var client = new LookupsClient(accountSid, authToken);
client.phoneNumbers('+15108675309').get({
type: 'carrier'
}, function(error, number) {
console.log(number.carrier.type);
console.log(number.carrier.name);
});
// This file is part of ThingPedia
//
// Copyright 2016 Weston Makoto Mizumoto
// Dersu Abolfathi
//
// See LICENSE for details
const Tp = require('thingpedia');
const LookupsClient = require('twilio').LookupsClient;
// Twilio Credentials
var accountSid = 'AC9d005f8a60c176bbcccc85c57694b2c7';
var authToken = 'e93833ab8bd579edb0dafb4ca95056c3';
//require the Twilio module and create a REST client
var client = LookupsClient(accountSid, authToken);
var messagingClient = require('twilio')(accountSid, authToken);
module.exports = new Tp.ChannelClass({
Name: "Lookup",
sendEvent: function(event) {
var recipientNumber = event[0];
var queryNumber = event[1];
console.log('Looking up query number: '+queryNumber);
client.phoneNumbers(queryNumber).get( {
type: 'carrier'
}, function(error, number) {
messagingClient.sendMessage({
to:String(recipientNumber),
from:'+16506668936',
export default function verify(phone) {
if (!client) client = new twilio.LookupsClient(accountSid, authToken);
return new Promise(resolve => {
if (!checkEligibility(phone)) {
resolve('na');
return;
}
client.phoneNumbers(phone).get(
{
type: 'carrier',
addOns: 'whitepages_pro_phone_rep',
},
(error, result) => {
if (error) {
if (error.code === 20404) {
console.log('Twilio phone not found ', phone);
resolve('block');
} else {