Giter Club home page Giter Club logo

ec-grammars-dig's Introduction

EC-Grammars-DIG

EC::Grammars::DIG is a module that provides a very easy and clear way to parse the dig command.

It is part of the project HON, a blockchain that is being written in Perl6.

Main features of this module

  • run dig command and receive main results parsed
  • GNU Licensed - Software Livre

This module performs generic parsing on rules and tokens.

Contents

Base Grammar

  • EC::Grammars::DIG - Digs into dig with url

Parser Actions

EC::Grammars::DIG will provide important information parsed like the IPs, the urls, used mainly for seeded out digs for P2P networks. A simple usage would be:

use EC::Grammars::DIG;
my $proc = run 'dig', URL_YOU_WANT_TO_DIG_HERE, :out, :err;
with $proc.err { say "Error running dig"; die; }
my $output = $proc.out.slurp: :close;
my $dig = EC::Grammars::DIG.new.parse( $output, :actions( EC:Grammars::DIG::Actions.new ) );
say $dig<DATE>; ## you may here query which ever tokens or rules desired
## TO ITERATE USE, FOR INSTANCE:
for $dig<ANSWER> -> $answers {
say $answers<IP>; ## for instance

Actions Options

  • :lax Pass back, don't drop, quantities with unknown dimensions.

Installation

With zef:

zef install EC::Grammars::DIG

You'll first need to download and build Rakudo Star or better (http://rakudo.org/downloads/star/ - don't forget the final make install):

Ensure that perl6 and panda are available on your path, e.g. :

% export PATH=~/src/rakudo-star-2015.07/install/bin:$PATH

You can then use panda to test and install CSS::Grammar:

% panda install EC::Grammars::DIG

To try parsing some content:

% perl6 -MCSS::EC::Grammars::DIG -e"say EC::Grammars::DIG.parse( run 'dig', 'YOUR_URL_TO_DIG')"

See Also

References

This module been built from the W3C CSS Specifications. In particular:

ec-grammars-dig's People

Contributors

bioduds avatar rafaelschipiura avatar zoffixznet avatar

Stargazers

 avatar

Watchers

 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.