GithubHelp home page GithubHelp logo

romvnly-gaming / hostingbot.net Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 175 KB

Unofficial module for handling API request with hostingbot.net, meant to be optimized for hostingbot.net using virtualizor.

Home Page: https://github.com/Romvnly-Gaming/hostingbot.net#README.md

License: MIT License

JavaScript 100.00%
api-wrapper api

hostingbot.net's Introduction

HostingBot Logo
Module License Module Version

HostingBot.net API Wrapper

Installation

npm install Romvnly-Gaming/hostingbot.net --save

Why use this module?

Personally I've been a customer of hostingbot.net for awhile now and I've seen how people love to integrate APIs with their bot. Using their hosting provider's API allows for rich information to be easily accessed.

Speed

I've done my best to try and optimize this module for speed. Currently, the HostingBot API is not the fastest so I've done some nice tricks to get past that and deliver content secure and fast.

Usage

const HostingBot = require("Romvnly-Gaming/hostingbot.net"); // REQUIRE THE MODULE
const credentials = { // Don't be like me, have these values in a protected file.
      apiKey: "hostingbot-apiKey", // API Key from hostingbot.net
      apiPass: "hostingbot-apiPass", // API pass from hostingbot.net
      svs: 69, // Secure Virtual Server ID from hostingbot.net
      cache: true // Whether or not to cache responds from HostingBot's API for speed, defaults to true 
};
const VPS = new HostingBot.VPS(credentials); // Used for general VPS Actions.
const Statistics = VPS.getBandwidth(); // Returns a promise object
console.log(Statistics); 
// {
//   bandwidth: {
//     limit: 4000,
//     used: 23.14
//   },
//   month: {
//     yr: '2020',
//     month: '10',
//     mth_txt: '20 Oct 2020\n19 Nov 2020',
//     days: '31'
//   }
// }
const Account = new HostingBot.Account(credentials); // Used for general account actions. 
const myAccount = Account.fetch(); // Fetches directly from the HostingBot API due to a acceptable speed. Returns {Promise<Object>}
console.log(myAccount)
// {
//    "fname":"Romvnly",
//    "lname":"Gaming",
//    "language":"english",
//    "email":"[email protected]",
//    "uid":24
// }

Get API Information

Go to the Client Area in hostingbot.net HostingBot Client Area

And then from the virtualizor dashboard, get your Virtual Private Server's ID. This is your 'svs' that we use to fetch from the HostingBot API. HostingBot Virtualizor

Now, you need to create a API key pair as they're not generated by HostingBot.net automatically for security. HostingBot Virtualizor Area And boom, you've created a API user! Please make sure to keep all your credentials safe, if you ever lose them, you should REVOKE them from the virtualizor dashboard.

Important

This is a API Wrapper for hostingbot.net from an customer for fellow customers. In no way does Hostingbot, LLC have any involvement in the development of this module besides just providing API endpoints for their customers. Use at your own risk.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Donating

Sadly, there is no way of directly donating to me. This module was made to help HostingBot customers and the README.md uses copyrighted HostingBot assets so out of respect I won't be providing a donation method besides using my HostingBot Affiliate Link and purchasing services from HostingBot.

License

MIT

hostingbot.net's People

Contributors

romvnly-gaming avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.