github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

bhyde / cl-etsy

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Common Lisp support for the Etsy API — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Avoid FIRST as slot name du locked package. 
bhyde (author)
Sun Apr 05 10:48:54 -0700 2009
commit  a63d215776c3817130fca523569c360b061baebb
tree    434b1ff8382e7f0e0487b2364e8357dee95584c6
parent  7ee989821c993ee9809424bcee6e3c7bedd80458
cl-etsy /
name age
history
message
file .gitignore Fri Mar 27 09:12:19 -0700 2009 Initial version, seems to work. [bhyde]
file README Fri Mar 27 09:12:19 -0700 2009 Initial version, seems to work. [bhyde]
file TODO Fri Mar 27 13:43:00 -0700 2009 Add entry r. secret admirers [bhyde]
file base.lisp Sun Apr 05 10:48:54 -0700 2009 Avoid FIRST as slot name du locked package. [bhyde]
file cl-etsy.asd Fri Mar 27 09:12:19 -0700 2009 Initial version, seems to work. [bhyde]
file main.lisp Fri Mar 27 09:12:19 -0700 2009 Initial version, seems to work. [bhyde]
file methods.lisp Fri Mar 27 15:50:01 -0700 2009 Tidy up methods.lisp. [bhyde]
file packages.lisp Sun Apr 05 08:02:20 -0700 2009 Many Changes. Export the slot names for all th... [bhyde]
file types.lisp Sun Apr 05 08:02:20 -0700 2009 Many Changes. Export the slot names for all th... [bhyde]
README
CL-Etsy bridges from Common Lisp to version 1 of the Etsy.com API[2].  It is an asdf[1].  Once loaded the common lisp 
package "ETSY" exports one routine for each method in the API, and classes for user, shop, listing, and api-method.

The names used in the API specification use two spelling conventions.  Camel case is sued for method names, e.g. 
getUserDescription.  In cl-etsy these are converted to the usual lisp spelling, e.g. get-user-description.  Underscores 
are used for field names, e.g. user_name.  In cl-etsy these are converted to the usual Lisp spelling, e.g. user-name.

All routines in the API two values a list of results and a count.  For example
here we look for the first 3 users of the name "benjamin".

  ETSY> (get-users-by-name "benjamin" :limit 3  :detail-level :high)
  (#<USER 7123275: BenjaminHart2008> #<USER 7059119: benjamin6>
   #<USER 7026092: benjamin315>)
  128
  ETSY> 

Note the count is tells you how many results are available in total.  But it is
occationally the length the list of results.

It is uniform, if a bit counter intuitive, that routines that always return a
single value also follow this pattern.  For example:

  CL-USER> (etsy:get-server-epoch)
  (1238167857)
  1
  CL-USER> (etsy:ping)
  ("pong")
  1
  CL-USER> (etsy:get-user-details 93)
  (#<ETSY:USER 93: Rokali>)
  1
  CL-USER> 

Error are, at present, signaled by invoking error.  All http requests that
return other than HTTP code 200 signal an error.  For example:

  CL-USER> (handler-case (print (etsy:get-user-details 1)) (error (c) (format t "~A" c)))
  Failed API call 404 user_id 1 does not exist
  NIL
  CL-USER> (handler-case (print (etsy:get-user-details "bob/slash")) (error (c) (format t "~A" c)))
  Failed API call 404 Can't route command: /users/bob/slash
  NIL
  CL-USER> 

Of course before any of this works you will need to register[2] and then
create a "application"[4] so you have an an API KEY.  Then store that into
*API-KEY*, i.e.:

  (setf esty:*api-key* "thisreallyisnotanapikey")

CL-Etsy requires cl-ppcre, drakma, and cl-json.

[1] http://common-lisp.net/project/asdf/
[2] http://developer.etsy.com/docs
[3] http://developer.etsy.com/member/register
[4] http://developer.etsy.com/apps/myapps
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server