Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (34 sloc) 1.698 kb
395606a6 »
2010-11-29 Initial extraction
1 = Love
2
5cd93832 »
2010-11-29 README wording
3 This library accesses the Tender REST API. It is my ode to and thanks for the tender
4 lovemaking Aaron Patterson is doing on ActiveRecord.
395606a6 »
2010-11-29 Initial extraction
5
6 It is currently read-only, and made especially for scripts that import data from
7 Tender to use in your own application. Feel free to fork and add missing API calls.
8
9 == Why?
10
11 I previously used HTTParty to connect to the Tender API, but I ran into two issues:
12
13 * HTTParty's JSON decoding is really slow, and resulted in "stack level too deep"
14 exceptions. Love uses yajl to decode JSON instead.
15 * Because Tender does not check or convert the encoding of email messages that they
16 receive, invalid UTF-8 characters can get into the system, which will break Ruby
17 1.9. Love handles character encoding manually, and will replace all the invalid
18 UTF-8 characters by the UTF "unknown character" character.
618d13fa »
2010-11-29 README tweaks
19 * I had to handle paging manually to get all data. Love will automatically
395606a6 »
2010-11-29 Initial extraction
20 send multiple requests to get all the pages to iterate over all the available
21 objects.
22
618d13fa »
2010-11-29 README tweaks
23 == Installation
24
f8a5d6b8 »
2010-11-29 README fixes and additions.
25 Run <tt>gem install love</tt> or add <tt>gem "love"</tt> to your Gemfile.
618d13fa »
2010-11-29 README tweaks
26
395606a6 »
2010-11-29 Initial extraction
27 == Usage
28
29 require 'love'
a4f0a5ce »
2010-11-30 Refactoring and documentation.
30 tender = Love.connect('site', 'api_key')
395606a6 »
2010-11-29 Initial extraction
31
32 # Loop over all discussions:
33 tender.each_discussion do |discussion|
34 # your awesome stuff here
35 end
36
37 # Also available:
f8a5d6b8 »
2010-11-29 README fixes and additions.
38 tender.each_user { |u| ... }
395606a6 »
2010-11-29 Initial extraction
39 tender.each_queue { |q| ... }
40 tender.each_category { |c| ... }
41
f8a5d6b8 »
2010-11-29 README fixes and additions.
42 # Or get a single record, using an ID or HREF:
43 d = tender.get_discussion('12345')
a4f0a5ce »
2010-11-30 Refactoring and documentation.
44 u = tender.get_user('https://api.tenderapp.com/site/users/12345')
f8a5d6b8 »
2010-11-29 README fixes and additions.
45
395606a6 »
2010-11-29 Initial extraction
46 == About
47
f8a5d6b8 »
2010-11-29 README fixes and additions.
48 This library is written by Willem van Bergen for Shopify, and is MIT licensed.
395606a6 »
2010-11-29 Initial extraction
49
Something went wrong with that request. Please try again.