Giter Club home page Giter Club logo

wuparty's Introduction

WuParty

WuParty is a fairly lightweight wrapper for Wufoo’s REST API using HTTParty.

API Support

Wufoo’s REST API supports viewing and submitting entries, filtering entries, viewing reports, and viewing users.

This library supports all methods of Wufoo’s API version 3.0.

There is an older version of this library (version 0.1.x) that only supports version 2 of Wufoo’s API. Make sure you have latest version installed (1.0.0 or higher).

Source & Download

Installation

gem install wuparty

Usage

require 'wuparty'

ACCOUNT = 'accountname'
API_KEY = 'AAAA-BBBB-CCCC-DDDD'
FORM_ID = 'my-form-id'

wufoo = WuParty.new(ACCOUNT, API_KEY)

wufoo.forms # list all accessible forms and details
form = wufoo.form(FORM_ID) # or details for a specific form

# query all entries
form.entries

# ...or filter entries (see http://wufoo.com/docs/api/v3/entries/get/#filter)
form.entries([['Field1', 'Is_equal_to', 'Tim']])

# To submit, use field numbers shown on the 'API Information' page in Wufoo
result = wufoo.submit(
  'Field1' => 'Tim',
  'Field2' => 'Morgan'
})
if result['Success'] == 0
  puts result['ErrorText']
end

Feedback

I’d love to hear from you if you have suggestions for improvement, bug fixes, or whatever. Email me at [email protected] or fork the project and send a pull request.

timmorgan.org

Tests

To run the tests, you must create a form called “Test Form” and pass in its id via the ENV variable WUFOO_FORM_ID. Give the form a standard name and address field. Make the name field required. Then run:

WUFOO_ACCOUNT=accountname \
WUFOO_API_KEY=AAAA-BBBB-CCCC-DDDD \
WUFOO_FORM_ID=test-form \
ruby -rrubygems test/wuparty_test.rb

License

Copyright © 2010 Tim Morgan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

wuparty's People

Contributors

seven1m avatar

Watchers

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