Git Product home page Git Product logo

camplight's Introduction

Camplight

Camplight is a Python implementation of the Campfire API.

The project comes with a Python module that can be imported via import camplight and a simple command-line tool named camplight to utilize it.

Installation

The easiest way to install Camplight and its dependencies:

$ pip install camplight

Alternatively, you can install it from source:

$ git clone git://github.com/mlafeldt/camplight.git
$ cd camplight/
$ python setup.py install

(Note that Camplight requires Requests.)

API Usage

from camplight import Request, Campfire

request = Request('https://your-subdomain.campfirenow.com', 'your_token')
campfire = Campfire(request)

account = campfire.account()
rooms = campfire.rooms()

room = campfire.room('Danger')
room.join()
room.speak('ohai')
room.leave()

Client Usage

Usage: camplight [options] <command> [args]

Options:
  -h, --help            show this help message and exit
  -u URL, --url=URL     set Campfire URL
  -t TOKEN, --token=TOKEN
                        set API token for authentication
  -r ROOM, --room=ROOM  set Campfire room
  -v, --verbose         be more verbose

Global commands:
  account               get account information
  rooms                 list available rooms
  user [id]             get user information
  presence              list rooms the user is present in
  search <term>         search transcripts for term

Room commands (require --room to be set):
  status                get general room information
  recent                list recent messages in the room
  transcript            list all messages sent today to the room
  uploads               list recently uploaded files in the room
  join                  join the room
  leave                 leave the room
  lock                  lock the room
  unlock                unlock the room
  speak <message>       send a regular chat message
  paste <message>       paste a message
  play <sound>          play a sound
  set-name <name>       change the room's name
  set-topic <topic>     change the room's topic

Environment variables:
  CAMPFIRE_URL          same as --url
  CAMPFIRE_TOKEN        same as --token
  CAMPFIRE_ROOM         same as --room
  CAMPFIRE_VERBOSE      same as --verbose

Testing

Build Status

After cloning the repository, run the test suite using:

$ python setup.py test

You can generate a coverage report using coverage.py. First, install the coverage package:

$ pip install coverage

Now gather the data by running:

$ coverage run setup.py test

And create a report:

$ coverage report

You can also create a much nicer HTML report:

$ coverage html

Now open htmlcov/index.html in your browser.

License

Camplight is licensed under the terms of the MIT License. See LICENSE file.

Contact

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.