Re: [CODE4LIB] parse an OAI-PHM response

2007-07-30 Thread Harrison Dekker
Long live Gopher!

gopher://gopher.floodgap.com/


On 7/30/07, Andrew Hankinson <[EMAIL PROTECTED]> wrote:
>
> I haven't heard the words "Gopher" and "Killer App" used in the same
> sentence for a looong time.
> Thanks!
>
> On 7/30/07, Tim Shearer <[EMAIL PROTECTED]> wrote:
> >
> > Depending on how locked down the php.ini file is (lots of good reasons
> to
> > do this) you might look into curl.
> >
> > http://curl.haxx.se/
> >
> > Curl can work in php.
> >
> > http://us.php.net/curl
> >
> > It talks lots of protocols (including https, which is how I got on
> board),
> > including gopher for any killer apps you have planned.
> >
> > -t
> >
> > +++
> > Tim Shearer
> >
> > Web Development Coordinator
> > The University Library
> > University of North Carolina at Chapel Hill
> > [EMAIL PROTECTED]
> > 919-962-1288
> > +++
> >
> >
> >
> > On Fri, 27 Jul 2007, John McGrath wrote:
> >
> > > You could use either the PEAR HTTP_Request package, or the built-in
> > > fopen/fread commands, which can make http calls in addition to
> > > opening local files. The easiest way, though, in my opinion, is
> > > file_get_contents, which automatically dumps the response into a
> > > String object. And it's fast, apparently:
> > >
> > > http://us.php.net/manual/en/function.file-get-contents.php
> > >
> > > http://pear.php.net/package/HTTP_Request
> > > http://us.php.net/fopen
> > > http://us.php.net/manual/en/function.fread.php
> > >
> > > Best,
> > > John
> > >
> > > On Jul 27, 2007, at 9:31 PM, Andrew Hankinson wrote:
> > >
> > >> Hi folks,
> > >> I'm wanting to implement a PHP parser for an OAI-PMH response from
> our
> > >> Dspace installation.  I'm a bit stuck on one point: how do I get
> > >> the PHP
> > >> script to send a request to the OAI-PMH server, and get the XML
> > >> response in
> > >> return so I can then parse it?
> > >>
> > >> Any thoughts or pointers would be appreciated!
> > >>
> > >> Andrew
> >
>



--
Harrison Dekker
Coordinator of Data Services
Doe/Moffitt Libraries, UC Berkeley


Re: [CODE4LIB] executing a cgi script in the middle of a url

2007-07-30 Thread Alexander Johannesen
On 7/31/07, Eric Lease Morgan <[EMAIL PROTECTED]> wrote:
> What am I doing wrong? How do I need to configure Apache accordingly?

We use a bunch of URL rewrite rules to solve this issue. We have a
host of backend technologies like Perl, PHP, CGI, Java, but all the
URL are equally clean.

We set up one set of rules per service point, where a 'point' is
defined in a rather technological fashion in addition to the semantic
value, so soa.nla.gov.au/users is redirected to
ws.nla.gov.au/services/usermanagement/index.cgi, including all
sub-paths from this point.


Alex
--
 ---
 Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps
-- http://shelter.nu/blog/ 


Re: [CODE4LIB] executing a cgi script in the middle of a url

2007-07-30 Thread Harrison Dekker
Eric,

You'll have to enable mod_rewrite for Apache and figure out how to create
the appropriate url rewriting rules (basically, regular expressions). Here's
a site that gives some examples:

http://www.the-art-of-web.com/system/rewrite/1/

-Harrison

On 7/30/07, Eric Lease Morgan <[EMAIL PROTECTED]> wrote:
>
> Tim Hodson wrote:
>
> > In terms of versioning and user readability (you never know someone
> > may want to bookmark a url :) ), you could perhaps try a url that
> > looked something like this using two examples above:
> >
> > http://dewey.library.nd.edu/mylibrary/ws/v1/facets/
>
>
> How do I get Apache to execute a CGI script in the middle of a URL?
>
> I have been reading RESTful Web Services in an effort to learn how to
> create a "good" Web Services interface to MyLibrary. Similar to the
> URL above, it advocates against (simple/traditional) name/value pairs
> specified in a GET request. Instead it advocates for the fuller use
> of HTTP methods such as GET, HEAD, POST, PUT, DELETE, TRACE, and
> OPTIONS in combination with path_info data used for input. In such an
> environment an HTTP GET request would retrieve data. PUT might create
> data. POST might edit data. DELETE would... delete data. Etc. I can
> live with this even though it is not the way I would have done it on
> my own.
>
> Thus, one of my URL's might look like this:
>
>http://example.edu/mylibrary/resource
>
> Sent as a GET request, the response would be an XML (or JSON) stream
> of data listing resource names or IDs . The following URL, sent as a
> PUT request might create a resource:
>
>http://example.edu/mylibrary/resource/Wikipedia
>
> All of this is fine and dandy. Writing a CGI script (server
> application) that looks at the HTTP method and parses the path_info (/
> resource/Wikipedia) and branches accordingly is rather trivial.
>
> My problem is getting Apache to know that /resource/Wikipedia is
> intended to be input for the script named mylibrary. When I pass
> something like the URL directly above to my script Apache comes back
> and says, "File not found" because it is looking for a directory/file
> named Wikipedia. How do I get Apache to execute the script named
> mylibrary? I could specify the URL like the following, but it is ugly:
>
>http://example.edu/mylibrary/index.cgi/resource/Wikipedia
>
> What am I doing wrong? How do I need to configure Apache accordingly?
>
> --
> Eric Lease Morgan
> University Libraries of Notre Dame
>



--
Harrison Dekker
Coordinator of Data Services
Doe/Moffitt Libraries, UC Berkeley


[CODE4LIB] executing a cgi script in the middle of a url

2007-07-30 Thread Eric Lease Morgan

Tim Hodson wrote:


In terms of versioning and user readability (you never know someone
may want to bookmark a url :) ), you could perhaps try a url that
looked something like this using two examples above:

http://dewey.library.nd.edu/mylibrary/ws/v1/facets/



How do I get Apache to execute a CGI script in the middle of a URL?

I have been reading RESTful Web Services in an effort to learn how to
create a "good" Web Services interface to MyLibrary. Similar to the
URL above, it advocates against (simple/traditional) name/value pairs
specified in a GET request. Instead it advocates for the fuller use
of HTTP methods such as GET, HEAD, POST, PUT, DELETE, TRACE, and
OPTIONS in combination with path_info data used for input. In such an
environment an HTTP GET request would retrieve data. PUT might create
data. POST might edit data. DELETE would... delete data. Etc. I can
live with this even though it is not the way I would have done it on
my own.

Thus, one of my URL's might look like this:

  http://example.edu/mylibrary/resource

Sent as a GET request, the response would be an XML (or JSON) stream
of data listing resource names or IDs . The following URL, sent as a
PUT request might create a resource:

  http://example.edu/mylibrary/resource/Wikipedia

All of this is fine and dandy. Writing a CGI script (server
application) that looks at the HTTP method and parses the path_info (/
resource/Wikipedia) and branches accordingly is rather trivial.

My problem is getting Apache to know that /resource/Wikipedia is
intended to be input for the script named mylibrary. When I pass
something like the URL directly above to my script Apache comes back
and says, "File not found" because it is looking for a directory/file
named Wikipedia. How do I get Apache to execute the script named
mylibrary? I could specify the URL like the following, but it is ugly:

  http://example.edu/mylibrary/index.cgi/resource/Wikipedia

What am I doing wrong? How do I need to configure Apache accordingly?

--
Eric Lease Morgan
University Libraries of Notre Dame


Re: [CODE4LIB] parse an OAI-PHM response

2007-07-30 Thread Andrew Nagy
Andrew, I began building a PHP OAI Client library based on a OAI Server library 
that I wrote a while back.  The OAI Client library is not complete, but it can 
get you started.  I attached it in a file called Harvester.php

Andrew

> -Original Message-
> From: Code for Libraries [mailto:[EMAIL PROTECTED] On Behalf Of
> Andrew Hankinson
> Sent: Friday, July 27, 2007 9:32 PM
> To: CODE4LIB@listserv.nd.edu
> Subject: [CODE4LIB] parse an OAI-PHM response
>
> Hi folks,
> I'm wanting to implement a PHP parser for an OAI-PMH response from our
> Dspace installation.  I'm a bit stuck on one point: how do I get the
> PHP
> script to send a request to the OAI-PMH server, and get the XML
> response in
> return so I can then parse it?
>
> Any thoughts or pointers would be appreciated!
>
> Andrew


Harvester.php
Description: Harvester.php


Re: [CODE4LIB] parse an OAI-PHM response

2007-07-30 Thread Andrew Hankinson
I haven't heard the words "Gopher" and "Killer App" used in the same
sentence for a looong time.
Thanks!

On 7/30/07, Tim Shearer <[EMAIL PROTECTED]> wrote:
>
> Depending on how locked down the php.ini file is (lots of good reasons to
> do this) you might look into curl.
>
> http://curl.haxx.se/
>
> Curl can work in php.
>
> http://us.php.net/curl
>
> It talks lots of protocols (including https, which is how I got on board),
> including gopher for any killer apps you have planned.
>
> -t
>
> +++
> Tim Shearer
>
> Web Development Coordinator
> The University Library
> University of North Carolina at Chapel Hill
> [EMAIL PROTECTED]
> 919-962-1288
> +++
>
>
>
> On Fri, 27 Jul 2007, John McGrath wrote:
>
> > You could use either the PEAR HTTP_Request package, or the built-in
> > fopen/fread commands, which can make http calls in addition to
> > opening local files. The easiest way, though, in my opinion, is
> > file_get_contents, which automatically dumps the response into a
> > String object. And it's fast, apparently:
> >
> > http://us.php.net/manual/en/function.file-get-contents.php
> >
> > http://pear.php.net/package/HTTP_Request
> > http://us.php.net/fopen
> > http://us.php.net/manual/en/function.fread.php
> >
> > Best,
> > John
> >
> > On Jul 27, 2007, at 9:31 PM, Andrew Hankinson wrote:
> >
> >> Hi folks,
> >> I'm wanting to implement a PHP parser for an OAI-PMH response from our
> >> Dspace installation.  I'm a bit stuck on one point: how do I get
> >> the PHP
> >> script to send a request to the OAI-PMH server, and get the XML
> >> response in
> >> return so I can then parse it?
> >>
> >> Any thoughts or pointers would be appreciated!
> >>
> >> Andrew
>


Re: [CODE4LIB] parse an OAI-PHM response

2007-07-30 Thread Tim Shearer

Depending on how locked down the php.ini file is (lots of good reasons to
do this) you might look into curl.

http://curl.haxx.se/

Curl can work in php.

http://us.php.net/curl

It talks lots of protocols (including https, which is how I got on board),
including gopher for any killer apps you have planned.

-t

+++
Tim Shearer

Web Development Coordinator
The University Library
University of North Carolina at Chapel Hill
[EMAIL PROTECTED]
919-962-1288
+++


On Fri, 27 Jul 2007, John McGrath wrote:


You could use either the PEAR HTTP_Request package, or the built-in
fopen/fread commands, which can make http calls in addition to
opening local files. The easiest way, though, in my opinion, is
file_get_contents, which automatically dumps the response into a
String object. And it's fast, apparently:

http://us.php.net/manual/en/function.file-get-contents.php

http://pear.php.net/package/HTTP_Request
http://us.php.net/fopen
http://us.php.net/manual/en/function.fread.php

Best,
John

On Jul 27, 2007, at 9:31 PM, Andrew Hankinson wrote:


Hi folks,
I'm wanting to implement a PHP parser for an OAI-PMH response from our
Dspace installation.  I'm a bit stuck on one point: how do I get
the PHP
script to send a request to the OAI-PMH server, and get the XML
response in
return so I can then parse it?

Any thoughts or pointers would be appreciated!

Andrew


Re: [CODE4LIB] code4lib.org hosting

2007-07-30 Thread Andrew Nagy
In case I can't make the conversation, I must suggest Bastille - a linux 
package that does firewalling and IP Masquerading.  I have been using it for 
about 8 years now and have never had a hacked linux box running it.

I even had my ISP kill my network connection once because my server was being 
attacked by thousands of machines and never once got through and the machine 
never experienced any performance degredation.

http://www.bastille-linux.org/

Good luck
Andrew

> -Original Message-
> From: Code for Libraries [mailto:[EMAIL PROTECTED] On Behalf Of
> Ed Summers
> Sent: Friday, July 27, 2007 5:18 PM
> To: CODE4LIB@listserv.nd.edu
> Subject: [CODE4LIB] code4lib.org hosting
>
> As you may have seen or experienced code4lib.org is down for the count
> at the moment because of some hackers^w crackers who compromised anvil
> and defaced various web content and otherwise messed with the
> operating system. anvil is a machine that several people in the
> code4lib community run and pay for themselves.
>
> Given that code4lib has grown into a serious little gathering, with
> lots of effort being expended by the likes of Jeremy Frumkin and Brad
> LaJenuesse to make things happen -- it seems a shame to let this sort
> of thing happen. We don't have any evidence, but it seems that the
> entry point was the fact that various software packages weren't kept
> up to date.
>
> Anyhow, this is a long way of inviting you to a discussion Aug 1st
> @7PM GMT in irc://chat.freenode.net/code4lib to see what steps need to
> be taken to help prevent this from happening in the future.
> Specifically we're going to be talking about moving some of the web
> applications to institutions that are better set up to manage them.
>
> If this interests you at all try to attend!
>
> //Ed


Re: [CODE4LIB] Rails

2007-07-30 Thread Jonathan Rochkind

I just taught myself with the 2nd ed. of the Agile Development with
Rails book, and still found it both entirely satisfactory and
sufficient. I'd get the "Programming Ruby" (Pickaxe) book too, since you
want to know Ruby to work with Rails, of course.

Personally, I can't handle only having an electronic copy, I need a
print copy open on my desk next to my monitor for tutorial or reference.

Jonathan

Carol Bean wrote:

I started playing around with Rails a couple years ago, then got
sidetracked.  Now I have a project I'd like to put into Rails, and need
to get back up to speed.  I have an electronic copy of the original
Pragmatic Programmers book on Rails, but there are now several other
books out (as well as a newer version of the PP book, I believe).  Any
recommendations?

Thanks,
Carol Bean
beanworks.wordpress.com



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