Coder Social home page Coder Social logo

chronolabs-cooperative / strata-api-php Goto Github PK

View Code? Open in Web Editor NEW
2.0 7.0 0.0 16.72 MB

Internet/Transnets Strata + Fallout Services API

Home Page: http://strata.snails.email/

License: GNU General Public License v3.0

PHP 85.94% HTML 0.17% CSS 13.60% JavaScript 0.28%
fallout strata tld htaccess crontab mod-rewrite cron-jobs api api-server api-rest

strata-api-php's Introduction

Chronolabs Cooperative presents

Internet/Transnetworking Strata + Fallout REST Services API

Version: 2.1.13 (final major)

Author: Dr. Simon Antony Roberts ([email protected]) - (c) 2016 - 2026

The ISF API Provides a drill down list of all the Internet Realms, TLD, gTLD that are currently available to the network strata you are in. It also provides country or place fallout which is associated with going on the end of the nodes in the strata.

A TLD, gTLD is not fortified until it has a fallout domain associated with it takeup; otherwise it is floating flambount in the marketplace with no nation or fallout channelling in it physicality.

Mod Rewrite .htaccess on root path

The following mod rewrite module extension which you have to enable in apache2 with: $ sudo a2enmod rewrite after doing so the following .htaccess goes in the root if it isn't there already

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^v2/(strata|fallout)/(.*?).api index.php?mode=$1&output=$2 [L,NC,QSA]
RewriteRule ^v2/(strata)/([0-9]+)/(.*?).api index.php?mode=$1&length=$2&output=$3 [L,NC,QSA]
RewriteRule ^v2/(strata)/([a-z]+)/(.*?).api index.php?mode=$1&start=$2&output=$3 [L,NC,QSA]
RewriteRule ^v2/(strata)/([0-9]+)/([a-z]+)/(.*?).api index.php?mode=$1&length=$2&start=$3&output=$4 [L,NC,QSA]
RewriteRule ^v1/(strata|fallout)/(.*?).api index.php?mode=$1&output=$2 [L,NC,QSA]
RewriteRule ^v1/(strata)/([0-9]+)/(.*?).api index.php?mode=$1&length=$2&output=$3 [L,NC,QSA]
RewriteRule ^v1/(strata)/([a-z]+)/(.*?).api index.php?mode=$1&start=$2&output=$3 [L,NC,QSA]
RewriteRule ^v1/(strata)/([0-9]+)/([a-z]+)/(.*?).api index.php?mode=$1&length=$2&start=$3&output=$4 [L,NC,QSA]

Scheduled Cron Job Details.,

There is one or more cron jobs that is scheduled task that need to be added to your system kernel when installing this API, the following command is before you install the chronological jobs with crontab in debain/ubuntu

Execute:-
$ sudo crontab -e

CronTab Entry:

* */12 * * * /usr/bin/php -q /path/to/cronjobs/align-strata.php

##Licensing

  • This is released under General Public License 3 - GPL3 - Only!

Implementing in PHP

The following examples is how to implement this API in PHP

Raw Output Implementation

The following code implements the raw.api call for strata importing the implemented array:

$strata = eval("?>".file_get_contents("http://strata.localhost/v2/strata/raw.api")."<?php");

The following code implements the raw.api call for fallout importing the implemented array:

$fallout = eval("?>".file_get_contents("http://strata.localhost/v2/fallout/raw.api")."<?php");

JSON Output Implementation

The following code implements the json.api call for strata importing the implemented array:

$strata = json_decode(file_get_contents("http://strata.localhost/v2/strata/json.api"), true);

The following code implements the json.api call for fallout importing the implemented array:

$fallout = json_decode(file_get_contents("http://strata.localhost/v2/fallout/json.api"), true);

SERIAL Output Implementation

The following code implements the serial.api call for strata importing the implemented array:

$strata = unserialize(file_get_contents("http://strata.localhost/v2/strata/serial.api"));

The following code implements the serial.api call for fallout importing the implemented array:

$fallout = unserialize(file_get_contents("http://strata.localhost/v2/fallout/serial.api"));

XML Output Implementation

The following code implements the xml.api call for strata importing the implemented array:

$strata = new SimpleXMLElement(file_get_contents("http://strata.localhost/v2/strata/xml.api"));

The following code implements the xml.api call for fallout importing the implemented array:

$fallout = new SimpleXMLElement(file_get_contents("http://strata.localhost/v2/fallout/xml.api"));

strata-api-php's People

Contributors

draroberts avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.