Sammymullern / Mullern

MIT License
0 stars 0 forks source link

desv #1

Open Sammymullern opened 9 months ago

Sammymullern commented 9 months ago

Truecallerjs

<a href="https://www.npmjs.com/package/truecallerjs"
    ><img src="https://img.shields.io/npm/v/truecallerjs.svg" alt="Version"
/></a>
<a href="https://github.com/sumithemmadi/truecallerjs/stargazers"
    ><img
        src="https://img.shields.io/github/stars/sumithemmadi/truecallerjs"
        alt="Stars"
/></a>
<a href="https://github.com/sumithemmadi/truecallerjs"
    ><img
        src="https://img.shields.io/npm/dt/truecallerjs.svg"
        alt="weekly Download"
/></a>
<a href="https://github.com/sumithemmadi/truecallerjs/blob/main/LICENSE"
    ><img src="https://img.shields.io/npm/l/truecallerjs.svg" alt="License"
/></a>
<a href="https://github.com/sumithemmadi/truecallerjs#license"
    ><img
        src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsumithemmadi%2Ftruecallerjs.svg?type=shield"
        alt="FOSSA Status"
/></a>
<a href="https://github.com/sumithemmadi/truecallerjs"
    ><img
        src="https://img.shields.io/npms-io/maintenance-score/truecallerjs"
        alt="Maintenance"
/></a>
<a href="https://github.com/sumithemmadi/truecallerjs/issues"
    ><img
        src="https://img.shields.io/github/issues/sumithemmadi/truecallerjs"
        alt="issues"
/></a>
<br>
<p>A simple package to search phone number details.</p>

Requirements

Command Line Usage

Installation

Install this npm package globally.

npm install -g  truecallerjs

Login

Then login to your truecaller account .

~$ truecallerjs login

If you get any error try running 'sudo truecallerjs login'. If you are using Windows try the command with Adminitrative Privilege.

If you still facing problems in login then try below steps.

  1. On Truecaller Android, tap on the 3 line menu on top left then click on setting's.
  2. Tap on Privacy Center and then click on Download my data.
  3. Now a json file is downloaded.
  4. Save the json file on your PC at any location e.g /home/HP/1234567890-99123456789.json
  5. On you terminal or command prompt enter below command.
    ~$ truecallerjs login /home/HP/1234567890-99123456789.json
  6. Now you are successfully logged in.

InstallationId

Enter the below command to see your InstallationId.

truecallerjs --installationid

Print only installation Id.

truecallerjs -i -r

Searching a number

~$ truecallerjs -s [number]
{
   "data": [
      {
         "id": "jsiebejebbeebhee/dnss00w==",
         "name": "Sumith Emmadi",
         "imId": "1g7rm006b356o",
         "gender": "UNKNOWN",
         "image": "https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb",
         "score": 0.9,
         "access": "PUBLIC",
         "enhanced": true,
         "phones": [
            {
               "e164Format": "+000000000000",
               "numberType": "MOBILE",
               "nationalFormat": "+000000000000",
               "dialingCode": 91,
               "countryCode": "IN",
               "carrier": "Airtel",
               "type": "openPhone"
            }
         ],
         "addresses": [
            {
               "city": "Andhra Pradesh",
               "countryCode": "IN",
               "timeZone": "+05:30",
               "type": "address"
            }
         ],
         "internetAddresses": [
            {
               "id": "email@gmail.com",
               "service": "email",
               "caption": "Sumith Emmadi",
               "type": "internetAddress"
            }
         ],
         "badges": [
            "verified",
            "user"
         ],
         "cacheTtl": "",
         "sources": [],
         "searchWarnings": [],
         "surveys": []
      }
   ],
   "provider": "ss-nu",
   "stats": {
      "sourceStats": []
   }
}

To get raw output.

~$ truecallerjs -r -s [number]

{"data":[{"id":"jsiebejebbeebhee/dnss00w==","name":"Sumith Emmadi","imId":"1g7rm006b356o","gender":"UNKNOWN","image":"https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb","score":0.9,"access":"PUBLIC","enhanced":true,
"phones":[{"e164Format":"+000000000000","numberType":"MOBILE","nationalFormat":"+000000000000","dialingCode":91,"countryCode":"IN","carrier":"Airtel","type":"openPhone"}],"addresses":[{"city":"Andhra Pradesh","countryCode":"IN","timeZone":"+05:30","type":"address"}],
"internetAddresses":[{"id":"email@gmail.com","service":"email","caption":"Sumith Emmadi","type":"internetAddress"}],"badges":["verified","user"],"cacheTtl":"","sources":[],"searchWarnings":[],"surveys":[]}],"provider":"ss-nu","stats":{"sourceStats":[]}}

To make a bulk number search

~$ truecallerjs --bs [Numbers seperated by comma]
Example : 
 ~$ truecallerjs --bs 9912345678,+14051234567,+919987654321

To print only name.

~$ truecallerjs -s [number] --name

Name : Sumith Emmadi
Aternate name : sumithemmadi  ## print's alternate name if exist

Other command's

~$ truecallerjs -s [number] -r --name

Sumith Emmadi

Output Formats

To get only JSON output

~$ truecallerjs -s [number] --json

To get XML output

~$ truecallerjs -s [number] --xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<root>
  <data>
    <id>jsiebejebbeebhee/dnss00w==</id>
    <name>Sumith Emmadi</name>
    <imId>1g7rm006b356o</imId>
    <gender>UNKNOWN</gender>
    <image>https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb</image>
    <score>0.9</score>
    <access>PUBLIC</access>
    <enhanced>true</enhanced>
    <phones>
      <e164Format>+000000000000</e164Format>
      <numberType>MOBILE</numberType>
      <nationalFormat>+000000000000</nationalFormat>
      <dialingCode>91</dialingCode>
      <countryCode>IN</countryCode>
      <carrier>Airtel</carrier>
      <type>openPhone</type>
    </phones>
    <addresses>
      <city>Andhra Pradesh</city>
      <countryCode>IN</countryCode>
      <timeZone>+05:30</timeZone>
      <type>address</type>
    </addresses>
    <internetAddresses>
      <id>email@gmail.com</id>
      <service>email</service>
      <caption>Sumith Emmadi</caption>
      <type>internetAddress</type>
    </internetAddresses>
    <badges>verified</badges>
    <badges>user</badges>
    <cacheTtl>
    </cacheTtl>
    <sources/>
    <searchWarnings/>
    <surveys/>
  </data>
  <provider>ss-nu</provider>
  <stats>
    <sourceStats/>
  </stats>
</root>

To get YAML output

~$ truecallerjs -s [number] --yaml
data: 
 - 
   id: "jsiebejebbeebhee/dnss00w=="
  name: "Sumith Emmadi"
  imId: 1g7rm006b356o
  gender: UNKNOWN
  image: "https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb"
  score: 0.9
  access: PUBLIC
  enhanced: true
  phones: 
   - 
   e164Format: "+000000000000"
    numberType: MOBILE
    nationalFormat: "+000000000000"
    dialingCode: 91
    countryCode: IN
    carrier: "Airtel"
    type: openPhone
  addresses: 
   - 
   city: "Andhra Pradesh"
    countryCode: IN
    timeZone: "+05:30"
    type: address
  internetAddresses: 
   - 
   id: "email@gmail.com"
    service: email
    caption: "Sumith Emmadi"
    type: internetAddress
  badges: 
   - 
   verified
   - 
   user
  tags: 
  nameFeedback: 
   nameSource: 1
   nameElectionAlgo: ""
  cacheTtl: ""
  sources: 
  searchWarnings: 
  surveys: 
provider: "ss-nu"
stats: 
 sourceStats: 

To get output as a plain text

~$ truecallerjs -s [number] --text
data                : 
id                  : jsiebejebbeebhee/dnss00w==
name                : Sumith Emmadi
imId                : 1g7rm006b356o
gender              : UNKNOWN
image               : https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb
score               : 0.9
access              : PUBLIC
enhanced            : true
phones              : 
e164Format          : +000000000000
numberType          : MOBILE
nationalFormat      : +000000000000
dialingCode         : 91
countryCode         : IN
carrier             : Airtel
type                : openPhone
addresses           : 
city                : Andhra Pradesh
countryCode         : IN
timeZone            : +05:30
type                : address
internetAddresses   : 
id                  : email@gmail.com
service             : email
caption             : Sumith Emmadi
type                : internetAddress
badges              : verified, user
cacheTtl            :
sources             : []
searchWarnings      : []
surveys             : []
provider            : ss-nu
stats               :
sourceStats         : []

To get HTML output

~$ truecallerjs -s [number] --html
<table>
   <tr>
      <th>Properties</th>
      <th>Values</th>
   </tr>
   <tr>
      <td>data</td>
      <td>
   <tr>
      <td>id</td>
      <td>jsiebejebbeebhee/dnss00w==</td>
   </tr>
   <tr>
      <td>name</td>
      <td>Sumith Emmadi</td>
   </tr>
   <tr>
      <td>imId</td>
      <td>1g7rm006b356o</td>
   </tr>
   <tr>
      <td>gender</td>
      <td>UNKNOWN</td>
   </tr>
   <tr>
      <td>image</td>
      <td>https://storage.googleapis.com/tc-images-noneu/myview/1/jdvdidbdhvdjdvddbkdbeiebeieb</td>
   </tr>
   <tr>
      <td>score</td>
      <td>0.9</td>
   </tr>
   <tr>
      <td>access</td>
      <td>PUBLIC</td>
   </tr>
   <tr>
      <td>enhanced</td>
      <td>true</td>
   </tr>
   <tr>
      <td>phones</td>
      <td>
   <tr>
      <td>e164Format</td>
      <td>+000000000000</td>
   </tr>
   <tr>
      <td>numberType</td>
      <td>MOBILE</td>
   </tr>
   <tr>
      <td>nationalFormat</td>
      <td>+000000000000</td>
   </tr>
   <tr>
      <td>dialingCode</td>
      <td>91</td>
   </tr>
   <tr>
      <td>countryCode</td>
      <td>IN</td>
   </tr>
   <tr>
      <td>carrier</td>
      <td>Airtel</td>
   </tr>
   <tr>
      <td>type</td>
      <td>openPhone</td>
   </tr>
   </td></tr>
   <tr>
      <td>addresses</td>
      <td>
   <tr>
      <td>city</td>
      <td>Andhra Pradesh</td>
   </tr>
   <tr>
      <td>countryCode</td>
      <td>IN</td>
   </tr>
   <tr>
      <td>timeZone</td>
      <td>+05:30</td>
   </tr>
   <tr>
      <td>type</td>
      <td>address</td>
   </tr>
   </td></tr>
   <tr>
      <td>internetAddresses</td>
      <td>
   <tr>
      <td>id</td>
      <td>email@gmail.com</td>
   </tr>
   <tr>
      <td>service</td>
      <td>email</td>
   </tr>
   <tr>
      <td>caption</td>
      <td>Sumith Emmadi</td>
   </tr>
   <tr>
      <td>type</td>
      <td>internetAddress</td>
   </tr>
   </td></tr>
   <tr>
      <td>badges</td>
      <td>verified, user</td>
   </tr>
   <tr>
      <td>cacheTtl</td>
      <td></td>
   </tr>
   <tr>
      <td>sources</td>
      <td>[]</td>
   </tr>
   <tr>
      <td>searchWarnings</td>
      <td>[]</td>
   </tr>
   <tr>
      <td>surveys</td>
      <td>[]</td>
   </tr>
   </td></tr>
   <tr>
      <td>provider</td>
      <td>ss-nu</td>
   </tr>
   <tr>
      <td>stats</td>
      <td>
   <tr>
      <td>sourceStats</td>
      <td>[]</td>
   </tr>
   </td></tr>
</table>

Basic Usage

npm install truecallerjs

Usage

const truecallerjs = require('truecallerjs');

var searchData = {
    number: "[PHONE_NUMBER]",
    countryCode: "[COUNTRY_CODE]",
    installationId: "[INSTALLATION_ID]"
}

var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
    console.log(response)
});

If you want output in different format's.

const truecallerjs = require('truecallerjs');

var searchData = {
    number: "[PHONE_NUMBER]",
    countryCode: "[COUNTRY_CODE]",
    installationId: "[INSTALLATION_ID]",
    output: "[FORMAT]"
}

var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
    console.log(response)
});
npm install -g  truecallerjs
truecallerjs --installationid

Examples

const truecallerjs = require('truecallerjs');

var searchData = {
    number: "9912345678",
    countryCode: "IN",
    installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
    output: "JSON"
}

var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
    console.log(response)
});

Here mobile number is in national format and country code is indian. So india is considered as a country code of that mobile number and response will be json format.

const truecallerjs = require('truecallerjs');

var searchData = {
    number: "+12093031250",
    countryCode: "IN",
    installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
    output: "XML"
}

var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
    console.log(response)
});

Here mobile number is in international format. So it is a US number.

const truecallerjs = require('truecallerjs');

var searchData = {
    number: "09912345678",
    countryCode: "IN",
    installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
    output: "YAML"
}

var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
    console.log(response)
});
const truecallerjs = require('truecallerjs');

var searchData = {
    number: "09912345678",
    countryCode: "IN",
    installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
    output: "TEXT"
}

var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
    console.log(response)
});
const truecallerjs = require('truecallerjs');

var searchData = {
    number: "09912345678",
    countryCode: "IN",
    installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
    output: "HTML"
}

var sn = truecallerjs.searchNumber(searchData);
sn.then(function(response) {
    console.log(response)
});

Make a bulk search in your project.

const truecallerjs = require('truecallerjs');

var countryCode = "IN";
var installationId = "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug";
var phoneNumbers = "+9912345678,+14051234567,+919987654321" // Phone numbers seperated by comma's

const searchResult = truecallerjs.bulkSearch(phoneNumbers,countryCode,installationId)
searchResult.then(function (response) {
    const data = JSON.stringify(response, null, 2);
    console.log(data);
})