Coder Social home page Coder Social logo

btcym / wifipineapple-modules Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hak5/nano-tetra-modules

0.0 0.0 0.0 21.1 MB

The Official WiFi Pineapple Module Repository

Home Page: https://wifipineapple.com/modules

PHP 11.64% JavaScript 11.46% HTML 13.55% Python 55.78% C# 0.47% Roff 0.14% Shell 2.13% CSS 4.76% Hack 0.08%

wifipineapple-modules's Introduction

WiFi Pineapple Module Repository

This is the module repository for the WiFi Pineapple NANO and TETRA. All the community developed modules are stored here, and developers should create pull requests for any changes to their modules, or module additions.

Module Structure

A WiFi Pineapple Module is created with HTML, AngularJS and PHP. All HTML is done using the Bootstrap CSS framework, and AngularJS combined with our PHP API allows for asynchronus updating and easy to implement features for your module.

A basic module will request information through AngularJS to PHP, and then the PHP will provide a response to AngularJS, where it will then be displayed on the HTML page for the user to see.

+-------------------+         +--------------+         +-----------+         +------+
| AngularJS Request |   -->   | PHP Response |   -->   | AngularJS |   -->   | HTML |
+-------------------+         +--------------+         +-----------+         +------+

The structure of a module is as follows:

.
├── api
│   └── module.php
├── js
│   └── module.js
├── module.html
└── module.info

More information on creating modules can be found here while more information on the API can be found here.

module.info

The module.info file is a simple JSON array consisting of author, description, devices, title, and version. The version field will need to be updated with any pull request.

module.html

The WiFi Pineapple modules make use of Bootstrap to provide a good mobile viewing experience and a clean look. Module developers are encouraged to make use of Bootstrap components, such as responsive tables and the grid system. To learn more about Bootstrap, visit the Bootstrap Website. We also include a hook for atleast one AngularJS controller. You can learn more about AngularJS at the AngularJS Website.

<div class="row">
    <div ng-controller="ExampleController" class="col-md-12">
        {{ hello }}
    </div>
</div>

module.js

The js/module.js file will house the Javascript for your module, and will be the place for controller definitions, in this brief example it will be called ExampleController. We will also set a variable called $scope.hello with content we will receieve from our PHP.

registerController("ExampleController", ['$api', '$scope', function($api, $scope) {
    $api.request({
        module: 'ExampleModule',
        action: 'getHello'
    }, function(response) {
        $scope.hello = response.text;
    });
}])

This snippet makes use of our API to send a request to our PHP with the getHello action, and will set it a response into the $scope.hello variable.

module.php

The api/module.php file must be in the pineapple namespace, and contain a routing switch statement, for example:

<?php namespace pineapple;

class ExampleModule extends Module
{
    public function route()
    {
        switch ($this->request->action) {
            case 'getHello':
                $this->hello();
                break;
            }
    }
}

We will then need to call our function hello(), which should be private and should set a response:

private function hello()
{
    $this->response = array('text' => "Hello World");
}

Note: You should never use the closing ?> PHP tag in your module.php file.

wifipineapple-modules's People

Contributors

foxtrot avatar pidgy avatar sud0nick avatar sebkinne avatar 3ndg4me avatar catatonicprime avatar h4xl0r avatar noncenz avatar frozenjava avatar couchfault avatar audibleblink avatar adde88 avatar defektive avatar gscamelo avatar sundhaug92 avatar joebertj avatar malduhaymi avatar theblindrat avatar zartaz 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.