Giter Site home page Giter Site logo

assembla-lib's Introduction

assembla-lib

A library that provides an easier interface to Assemblas API.

This library is based off Assemblas new API (v1) referenced here. Right now it returns raw responses, in XML or JSON per Assemblas response.

Installation

  1. Add assembla-lib.el to your load path.

    (require 'assembla-lib)

Use M-x customize to set API Key and API Key Secret

Bugs/Enhancements

  • Adding oauth2 support?
  • Better (or any) error handling for 404 and 522 status code responses
  • Better responses to PUT/POST/DELETE requests.

Usage

; Get all spaces in JSON
(asl/get "spaces" "json" (lambda(response)
			      (with-current-buffer (get-buffer-create "assembla-test-buffer")
				  (erase-buffer)
				  (insert (format "%s" response)))))

; Create a basic ticket in space `space-id'
(asl/post-or-put (format "spaces/%s/tickets" space-id) "json" "{\"ticket\":{\"summary\":\"Assembla from Emacs?!\"}}" "POST" (lambda))

Caching Requests

assembla-lib will let you cache requests given you've customized asl/cache-enabled to t.

Using the other custom variables, you can alter where the cache files are stored, and the default duration for cached files.

Example

;; This will get the latest list of spaces in JSON, and cache it for 1 day
(asl/get "spaces" "json" 'some-callback nil 86400)

;; This will use the latest list of spaces from cache if they exist, otherwise it
;; will cache them for an hour.
(asl/get "spaces" "json" 'some-other-callback t 3600)

assembla-lib's People

Contributors

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