Git Product home page Git Product logo

vopher's Introduction

Vopher

tests

A simple library to parse Gopher pages from a Gopher server. Basic Gopher+ support is also included.

Originally written for a personal project, I decided to make it public in case someone else might find it useful.

Please note that this library is still in development and is not yet ready for production use. It is also not yet fully compliant with the Gopher+ protocol.

The API is subject to change until it reaches the 0.1.0 version

Installation

$ v install --git https://github.com/SheatNoisette/vopher.git

Quickstart

A simple example to get a Gopher page and parse it

import vopher

import net
import io

// Make a new connection
mut conn := net.dial_tcp("a_gopher_site.com:70") ?

// Ask the gopher server for the root
conn.write_string('/\r\n')!

// Get the response
result := io.read_all(reader: conn)!
page_str := result.bytestr()

// Parse the response
gopher := vopher.parse_page(page_str) ?

// Print the parsed response
println(gopher)

// Close the connection
conn.close() ?

For more examples, see the examples directory.

Documentation

Documentation can be generated using v doc:

$ v doc . -m -f html docs/

Tests

Tests can be run using v test:

$ v -stats test .

License

Licensed under the MIT License. See the LICENSE file for details.

vopher's People

Contributors

sheatnoisette avatar

Stargazers

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