1.1.0 • Published 4 years ago

hiveone-js v1.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Test Suite

Hive JS

Install

  1. Sign up for an Account at hive.one
  2. Get an API Key here
  3. Install via npm
npm install --save hiveone-js

Usage

Import into your project using the relevant method:

const hive = require('hiveone-js').default;
const api = hive({ apiKey: 'APIKEYHERE' });
import hive from 'hiveone-js';
const api = hive({ apiKey: 'APIKEYHERE' });

List Available Influencers

// Default
let response = await api.availableInfluncers();

// Requesting twitter_id's
let response = await api.availableInfluncers({ format: 'id' });
ArgumentRequiredDefaultOptionsPurpose
formatNoscreenNamescreenName, idChange the format of the influencer ID

Top Influencers

// Default
let response = await api.topInfluencers();

// BTC with pagination
let response = await api.topInfluencers({ cluster: 'BTC', after: 50 });
ArgumentRequiredDefaultOptionsPurpose
clusterNoCryptoCrypto, BTC, ETH, XRPSpecify the cluster you want the top influencers for
afterNo0Multiples of 50Used for pagination

Influencer Details

// Default
let response = await api.influencerDetails({ influencerId: 'jack' });

// Personal Rank Type
let response = await api.influencerDetails({ influencerId: 'jack', rankType: 'personal' });

// Include Followers
let response = await api.influencerDetails({ influencerId: 'jack', includeFollowers: 1 });

// Request using twitter_id
let response = await api.influencerDetails({ influencerId: '12', format: 'id' });
ArgumentRequiredDefaultOptionsPurpose
influencerIdYesUnique ID (Screen Name or Twitter ID) for the influencer you are requesting.
formatNoscreenNamescreenName, idChange the format of the influencer ID
rankTypeNoallall, personalPeople are treated differently from other types of influencers (Companies, bots, etc.), if you request all an influencers rank/score will reflect their influence across the entire cluster, if you request personal their rank/score will reflect their influence across other people in the cluster.
includeFollowersNo00, 1Allows you to get top followers for the requested influencer.

Influencer Rank/Score History

// Default
let response = await api.influencerHistory({ influencerId: 'jack' });

// Personal Rank Type
let response = await api.influencerHistory({ influencerId: 'jack', rankType: 'personal' });

// Request using twitter_id
let response = await api.influencerHistory({ influencerId: '12', format: 'id' });
ArgumentRequiredDefaultOptionsPurpose
influencerIdYesUnique ID (Screen Name or Twitter ID) for the influencer you are requesting.
formatNoscreenNamescreenName, idChange the format of the influencer ID
rankTypeNoallall, personalPeople are treated differently from other types of influencers (Companies, bots, etc.), if you request all an influencers rank/score will reflect their influence across our entire dataset, if you request personal their rank/score will reflect their infulencer across other people.

Influencers Podcasts

// Default
let response = await api.influencerPodcasts({ influencerId: 'jack' });

// appearance_type
let response = await api.influencerPodcasts({ influencerId: 'jack', rankType: 'personal' });

// Pagination
let response = await api.influencerPodcasts({ influencerId: 'jack', after: 20 });

// Request using twitter_id
let response = await api.influencerPodcasts({ influencerId: '12', format: 'id' });
ArgumentRequiredDefaultOptionsPurpose
influencerIdYesUnique ID (Screen Name or Twitter ID) for the influencer you are requesting.
formatNoscreenNamescreenName, idChange the format of the influencer ID
appearanceTypeNoallall, host, guestAllows you to filter podcasts whether the requested influencer was a host or a guest
afterNo0Multiples of 20Used for pagination

Batch Influencer Details

// Default
let response = await api.influencerHistory({ influencerIDS: [123, 123] });
ArgumentRequiredDefaultOptionsPurpose
influencerIDSYesAn array of twitter_ids for the influencers you want to retrieve.
rankTypeNoallall, personalPeople are treated differently from other types of influencers (Companies, bots, etc.), if you request all an influencers rank/score will reflect their influence across our entire dataset, if you request personal their rank/score will reflect their infulencer across other people.
includeFollowersNo00, 1Allows you to get top followers for the requested influencer.

Changing Defaults

You can change the defaults when initializing the library

You can change the default infleuncerID format like so:

const hive = require('hiveone-js').default;
const api = hive({ apiKey: 'APIKEYHERE', defaultFormat = 'id' });

You can also change the host the library connects to (Useful if you are caching hive.one data)

const hive = require('hiveone-js').default;
const api = hive({ apiKey: 'APIKEYHERE', host = 'https://hosthere' });

Contributions

  1. Reports for issues and suggestions can be made using the issue submission interface.
  2. Code contributions are submitted via pull requests

Developer Notes

Developer Install

Install the latest developer version with npm from github:

npm install git+https://github.com/hive-one/hive-js

Install from git cloned source:

  1. Ensure git is installed
  2. Clone into current path
  3. Install via npm
git clone https://github.com/hive-one/hive-js
cd hive-js
npm install

Tests

  1. Clone into current path git clone https://github.com/hive-one/hive-js
  2. Enter into folder cd hive-js
  3. Ensure devDependencies are installed and available
  4. Run tests
npm install
npm test
1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago