socialblade
Advanced tools
Comparing version 0.0.7 to 1.0.0
{ | ||
"name": "socialblade", | ||
"version": "0.0.7", | ||
"version": "1.0.0", | ||
"description": "Library for Social Blade's Official API in JavaScript (TypeScript)", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "mocha --reporter spec --require ts-node/register tests/*.test.ts", | ||
"lint": "tslint --project tsconfig.json --format stylish src/**/*.ts", | ||
"build": "tsc --module commonjs", | ||
"dev": "ts-node-dev --respawn ./lib/index.ts", | ||
"test": "mocha --reporter spec --require ts-node/register tests/*.ts", | ||
"tdd": "mocha --reporter min --require ts-node/register --watch-files tests/ --watch-files lib/ --watch --recursive tests/*.ts", | ||
"prepublish": "npm run build" | ||
}, | ||
"repository": "https://github.com/TimothyCole/socialblade-js", | ||
"repository": "https://github.com/SocialBlade/socialblade-js", | ||
"bugs": { | ||
"url": "https://github.com/TimothyCole/socialblade-js/issues" | ||
"url": "https://github.com/SocialBlade/socialblade-js/issues" | ||
}, | ||
@@ -20,22 +21,18 @@ "keywords": [ | ||
"social blade", | ||
"modesttim", | ||
"Timothy Cole" | ||
"socialblade api", | ||
"socialblade.com" | ||
], | ||
"author": "Timothy Cole <tim@socialblade.com>", | ||
"license": "BSD 3-Clause", | ||
"private": false, | ||
"devDependencies": { | ||
"@types/chai": "^4.1.5", | ||
"@types/mocha": "^5.2.5", | ||
"@types/request": "^2.47.1", | ||
"@types/request-promise-native": "^1.0.15", | ||
"chai": "^4.1.2", | ||
"mocha": "^5.2.0", | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.0.3" | ||
}, | ||
"dependencies": { | ||
"request": "^2.88.0", | ||
"request-promise-native": "^1.0.5" | ||
"@types/chai": "^4.2.12", | ||
"@types/mocha": "^8.0.3", | ||
"@types/node": "^14.10.1", | ||
"chai": "^4.2.0", | ||
"isomorphic-unfetch": "^3.0.0", | ||
"mocha": "^8.1.3", | ||
"prettier": "^2.1.1", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.2" | ||
} | ||
} |
@@ -1,19 +0,14 @@ | ||
# Social Blade API in JavaScript [<img align="right" src="https://cdn.tcole.me/socialblade-small.png">](https://github.com/TimothyCole/socialblade-js) | ||
# Social Blade API in TypeScript [<img align="right" src="https://socialblade.com/images/media/red/2.png">](https://socialblade.com/b) | ||
[![Build Status](https://travis-ci.com/TimothyCole/socialblade-js.svg?branch=master)](https://travis-ci.com/TimothyCole/socialblade-js) | ||
[![npm](https://img.shields.io/npm/v/socialblade.svg)](https://www.npmjs.com/package/socialblade) | ||
[![Personal Discord](https://img.shields.io/discord/313591755180081153.svg?label=Personal%20Discord&colorB=308bcd&maxAge=3600)](https://discordapp.com/invite/YFtfGwq) | ||
[![Social Blade Discord](https://img.shields.io/discord/125022847562285056.svg?label=Social%20Blade%20Discord%20(Not%20for%20Support)&colorB=c84329&maxAge=3600)](https://socialblade.com/discord) | ||
![Discord](https://img.shields.io/discord/125022847562285056?color=7289DA&label=Discord) | ||
--- | ||
### Information and Disclaimer | ||
Just because I work for Social Blade does not mean this is an official library. Though it is used in Social Blade official products. | ||
### API Information | ||
Our API allows you to take the power of the Social Blade website and intergrate it directly into your internal systems. | ||
This library supports most of the `api.socialblade.com` endpoints that are being exposed by either the official Social Blade Browser Extensions, Apps, or Website. | ||
You gain access to the same public statistical information that is on the website along with our toplists, rankings, and more as we keep expanding it's features! | ||
[<img align="right" height="40px" src="https://cdn.t.pics/socialblade-get-started.png">](https://socialblade.com/business-api) | ||
Social Blade's API is a private API used for Social Blade official tools and for companies with express written permission. Use of the Social Blade API without express permission is prohibited by the active [Terms of Service](https://socialblade.com/info/terms) and may result in being blocked from the Social Blade website and all of it's data. | ||
--- | ||
## Install | ||
@@ -24,20 +19,15 @@ ```bash | ||
> **Important**: Library does not force any fetch polyfills, If you don't already have a fetch polyfill we recommend using `isomorphic-unfetch` like the tests use. | ||
## Usage | ||
Import the library into your project and construct a new client which will be used to access the API. | ||
Use either the third-party `Auth` function or first-party `AuthAsUser` function to set the client as "active". | ||
#### TypeScript | ||
```ts | ||
import { SocialBladeClient } from 'socialblade'; | ||
import SocialBlade, { YouTubeUser } from 'socialblade'; | ||
const socialblade: SocialBladeClient = new SocialBladeClient(); | ||
// Third-Party Auth | ||
socialblade.Auth("Third-Party API Key").then((data: IDeveloper) => { | ||
console.log(data) | ||
}); | ||
const client: SocialBlade = new SocialBlade(SOCIALBLADE_CLIENT_ID, SOCIALBLADE_ACCESS_TOKEN); | ||
// First-Party Auth | ||
socialblade.AuthAsUser("User Email", "User Access Token").then((data: IUser) => { | ||
console.log(data) | ||
}); | ||
// Get a YouTube User | ||
const sbUser: YouTubeUser = await client.youtube.user('socialblade'); | ||
``` | ||
@@ -47,18 +37,14 @@ | ||
```js | ||
const SocialBladeClient = require("socialblade").SocialBladeClient; | ||
const SocialBlade = require("socialblade"); | ||
const socialblade = new SocialBladeClient(); | ||
// Third-Party Auth | ||
socialblade.Auth("Third-Party API Key").then(console.log) | ||
const client = new SocialBlade(SOCIALBLADE_CLIENT_ID, SOCIALBLADE_ACCESS_TOKEN); | ||
// First-Party Auth | ||
socialblade.AuthAsUser("User Email", "User Access Token").then(console.log) | ||
// Get a YouTube User | ||
client.youtube.user('socialblade').then(console.log); | ||
``` | ||
## Examples | ||
#### Get YouTube Channel Stats — [ [Third-Party Auth](examples/youtube-stats-Auth.js), [First-Party Auth](examples/youtube-stats-AuthAsUser.js) ] | ||
#### Get Twitch Channel Stats — [ [Third-Party Auth](examples/twitch-stats-Auth.js), [First-Party Auth](examples/twitch-stats-AuthAsUser.js) ] | ||
_More examples coming soon. Library still early development_ | ||
##### [Code Examples](examples) | ||
## Troubleshooting | ||
If you have official access to the Social Blade API via express permission from the company then feel free to contact me via [Twitter](https://twitter.com/messages/compose?recipient_id=1690693537) or [email me](mailto:tim@timcole.me?cc=tim@socialblade.com&subject=Social%20Blade%20JavaScript%20Library%20Inquiry) for any help. | ||
If you find an issue with this library feel free to open an issue here on GitHub, or submit a PR and others! 😀 | ||
If it's an issue when the API open a [support ticket](https://support.socialblade.com). |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
42778
0
110
759
0
0
1
9
49
2
- Removedrequest@^2.88.0
- Removedrequest-promise-native@^1.0.5
- Removedajv@6.12.6(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpsl@1.15.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedrequest-promise-core@1.1.4(transitive)
- Removedrequest-promise-native@1.0.9(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedstealthy-require@1.1.1(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)