2017 © Pedro Peláez
 

library getyourbit

Getyourbit.com client

image

ortex/getyourbit

Getyourbit.com client

  • Sunday, August 20, 2017
  • by ortex
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

GetYourBit.com client

This library allows you to make requests easily., (*1)

Examples

require 'vendor/autoload.php';    

use GetYourBit\Api;

// create an instance
$api = new Api('https://ip.getyourbit.com/');

// login
$api->auth('login', 'password');

// request without scrolling
$body = $api->request("/lookup/8.8.8.8", array('locale': 'en-US'));
var_dump($body['data']);

// request with scrolling
$result = $api->scroll("/find/", array(
    'size': 500,
    'query' => array(
        'country' => 'nepal'
    )
));
echo count($result);

//logout
$api->logout();

Api

.auth($login, $password, $options=array())

Login to the API. You can get $login and $password on the site after a subscription.
$options is requests module options. You can also pass headers as option
Free services don't require authorization., (*2)

.logout()

Logout from the API. It gives an error without authorization before., (*3)

.request($url, $data=array(), $options=array())

Request to the API without scrolling to get data.
It returns all response body as object., (*4)

.scroll($url, $data=array(), $options=array(), $callback=null)

.scroll($url, $data=array(), $callback=null)

.scroll($url, $callback=null)

Request to the API with scrolling to get data. You can pass callback to control every chunk. You will get three arguments:, (*5)

  • $body - chunk response body
  • $chunkData - chunk data
  • $fullData - full data by the current chunk

It returns the full data at the end, (*6)

The Versions

20/08 2017

dev-master

9999999-dev https://github.com/ortexx/getyourbit-php

Getyourbit.com client

  Sources   Download

MIT

The Requires

 

by Alexandr Balasyan

api geolocation ip proxy cidr getyourbit getyourbit.com

12/08 2017

v0.0.1

0.0.1.0 https://github.com/ortexx/getyourbit-php

Getyourbit.com client

  Sources   Download

MIT

The Requires

 

by Alexandr Balasyan

api geolocation ip proxy cidr getyourbit getyourbit.com