Print

Print


Okay. You're right actually. I was for whatever reason thinking that
this is not the case. Perhaps I made an error in my initial coding, but
I went back and tried the json_encode function again, and it performed
as you said, which also is how the documentation says it should behave.

This is my test code:

<?php

//$query = '{"key~":"/about/*"}';
$query = json_encode(array('key~'=>'\/about\/*'));
echo $query . "\n";
$curlRsc = curl_init();
$url = "http://openlibrary.org/api/things?query=" . urlencode($query) .
"\n";
echo "{$url}\n";
curl_setopt($curlRsc, CURLOPT_URL, $url);
curl_setopt($curlRsc, CURLOPT_HEADER, 1);
curl_setopt($curlRsc, CURLOPT_RETURNTRANSFER, 1);
$results = curl_exec($curlRsc);
echo $results;
echo curl_error($curlRsc) . "\n";


And this is the output, which behaves as expected:

{"key~":"\\\/about\\\/*"}
http://openlibrary.org/api/things?query=%7B%22key%7E%22%3A%22%5C%5C%5C%2
Fabout%5C%5C%5C%2F%2A%22%7D

HTTP/1.1 200 OK
Connection: close
Content-type: application/json
Content-Length: 560
Date: Thu, 05 Jun 2008 22:56:28 GMT
Server: lighttpd/1.4.15

{"status": "ok", "result": ["\/about\/architecture", "\/about\/banned",
"\/about\/calendar", "\/about\/catalog", "\/about\/contact",
"\/about\/faq", "\/about\/help", "\/about\/help\/libraries",
"\/about\/help\/oclc", "\/about\/help\/upload", "\/about\/infogami-dc",
"\/about\/jobs", "\/about\/lib", "\/about\/ol_info_sheet",
"\/about\/olmeeting2008", "\/about\/oln", "\/about\/pagelist",
"\/about\/people", "\/about\/press", "\/about\/publishers",
"\/about\/relnote", "\/about\/sample_publisher_letter",
"\/about\/schema", "\/about\/tech", "\/about\/vision"]}


Anyhow, thanks for the gentle nudge. The API seems to work just fine
after all!

---
David Cloutman <[log in to unmask]>
Electronic Services Librarian
Marin County Free Library

-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of
Jonathan Rochkind
Sent: Thursday, June 05, 2008 3:16 PM
To: [log in to unmask]
Subject: [CODE4LIB] refworks developer documentation?


Does anyone know where, if anywhere, I find documentation on the ways to
send references to RefWorks for importing?

Not having any luck on their website. I know I've seen it before
though.  I remember there were a variety of formats and methods you
could send things to RefWorks for an import. Must be documentation
somewhere?  I bet some code4libber has done this before.

Jonathan

--
Jonathan Rochkind
Digital Services Software Engineer
The Sheridan Libraries
Johns Hopkins University
410.516.8886
rochkind (at) jhu.edu

Email Disclaimer: http://www.co.marin.ca.us/nav/misc/EmailDisclaimer.cfm