regex and http in scheme 
Author Message
 regex and http in scheme

Hi!

        Are there any regex packages for scheme?  And for http?  I
need to POST data and also retrieve the contents of web pages.

        Basically I have to retrieve several webpages (web shops),
extract the prices of some items and return a report in html.  I would
apreciate any relevant info, since otherwise I'd have to do it in
Perl.... :-(

PS I'd be using mzscheme

//-----------------------------------------------
//      Fernando Rodriguez Romero
//
//      frr at mindless dot com
//------------------------------------------------



Sat, 16 Mar 2002 03:00:00 GMT  
 regex and http in scheme

Quote:
>    Are there any regex packages for scheme?  And for http?  I
>need to POST data and also retrieve the contents of web pages.

>    Basically I have to retrieve several webpages (web shops),
>extract the prices of some items and return a report in html.  I would
>apreciate any relevant info, since otherwise I'd have to do it in
>Perl.... :-(

>PS I'd be using mzscheme

Read the documentation.  

mzscheme has a regular expression "unit."

It also has a unit that "does web stuff."

Both are reasonably well-documented in the online help system.
--
"Show me... show me... show me... COMPUTERS!"



Mon, 18 Mar 2002 03:00:00 GMT  
 regex and http in scheme

I don't have information relevant to mzscheme, however I was intrigued
by the question of regular expression packages for Scheme:  Here is
what I came up with in a 10 mnute search:

The scsh faq mentions "Henry Spencer's regular expression package for Scheme"
It looks as thought the code uses foreign function calls to invoke C
code.

If your favorite Scheme supports foreign function calls, then you
might look at the scsh distribution to see the scheme code that they
put on top of the regex package (If your favorite Scheme is Scheme-48,
you might be able to lift the code entirely from scsh).

Guile has a regexp interface:
http://www.fsf.org/software/guile/notes/guile-1.2.html

SIOD and regexp turn up together in a search of the web:
http://people.delphi.com/gjc/siod_regex.html
But I don't know from the context if the SIOD referred to is the
Scheme implementation.

You could also look at the pattern matching code in the scheme
repository:
http://www.cs.indiana.edu/scheme-repository/code.match.html

I hope this helps.

-- Allyn



Mon, 18 Mar 2002 03:00:00 GMT  
 regex and http in scheme
+---------------
| Are there any regex packages for scheme?
...
| PS I'd be using mzscheme
+---------------

See the MzScheme documentation:

        http://www.cs.rice.edu/CS/PLT/packages/doc/mzscheme/node115.htm
        Regular Expressions
        MzScheme provides built-in support for regular expression pattern
        matching on strings, implemented by Henry Spencer's package.
        Regular expressions are specified as strings, using the same
        pattern language as the Unix utility egrep. String-based regular
        expressions can be compiled into a regexp value for repeated matches.

I use it to parse Web pages sucked off the net (using the built-in socket
support). Works great!

-Rob

p.s. Also, the PLT distribution now includes Shriram Krishnamurthi's networking
utilities in the plt/collects/net/ directory, including some URL & CGI stuff,
and some NNTP, SMTP, & POP3 utilities.

-----

Applied Networking              http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.          Phone: 650-933-1673
1600 Amphitheatre Pkwy.         FAX: 650-933-0511
Mountain View, CA  94043        PP-ASEL-IA



Tue, 19 Mar 2002 03:00:00 GMT  
 regex and http in scheme


Quote:
>I don't have information relevant to mzscheme, however I was intrigued
>by the question of regular expression packages for Scheme:  Here is
>what I came up with in a 10 mnute search:

I couldn't have searched enough, but I couldn't find a
regexp implementation that will load-and-run in _any_
RnRS-compliant Scheme.  

I have therefore placed in

        http://www.cs.rice.edu/~dorai/pregexp/pregexp.html

an R5RS (actually R4RS should be enough) regexp
implementation.  (It's something I'm working on as a
larger, non-boring recursion example for a Scheme
primer.)

--d



Fri, 22 Mar 2002 03:00:00 GMT  
 regex and http in scheme
+---------------
|         http://www.cs.rice.edu/~dorai/pregexp/pregexp.html
| an R5RS (actually R4RS should be enough) regexp implementation.
+---------------

Cool! The return value for your "pregexp-match" matches MzScheme's
"regexp-match-positions", which I always thought was much more useful
than MzScheme's "regexp-match", anyway.

Now all you need is "pregexp-replace" and "pregexp-replace*"...  ;-}

-Rob

-----

Applied Networking              http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.          Phone: 650-933-1673
1600 Amphitheatre Pkwy.         FAX: 650-933-0511
Mountain View, CA  94043        PP-ASEL-IA



Sat, 23 Mar 2002 03:00:00 GMT  
 regex and http in scheme

Quote:


>+---------------
>|         http://www.cs.rice.edu/~dorai/pregexp/pregexp.html
>| an R5RS (actually R4RS should be enough) regexp implementation.
>+---------------

>Cool! The return value for your "pregexp-match" matches MzScheme's
>"regexp-match-positions", which I always thought was much more useful
>than MzScheme's "regexp-match", anyway.

>Now all you need is "pregexp-replace" and "pregexp-replace*"...  ;-}

Oh, those should be easy -- it's just a matter of
figuring out canonical (modulo the pregexp) Scheme
names.  I think the latter portions of Shivers's text
introduce a set of names that have a very good chance
of getting SRFI-certified.  Next weekend...

--d



Sat, 23 Mar 2002 03:00:00 GMT  
 regex and http in scheme

Quote:

>    Basically I have to retrieve several webpages (web shops),
> extract the prices of some items and return a report in html.  I would
> apreciate any relevant info, since otherwise I'd have to do it in
> Perl.... :-(

What is this, a threat? (-:

Quote:
> PS I'd be using mzscheme

Send me a personal email message and I'll send you a pointer to a PLT
Scheme (MzScheme) collection that keeps track of stock values.  You
will probably find the code in there is quite similar to what you
need: it retrieves a Web page and regexp's through it to pull out the
current value of the stock.  You can adapt it to your needs.

This package isn't part of the PLT distribution for somewhat obvious
reasons: it uses an ad-hoc regexp query over an undocumented Web page
syntax, so it is liable to stop working at any time or, worse still,
to produce incorrect information.

'shriram



Mon, 25 Mar 2002 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Scheme->C regex interface

2. Aubrey Jaffer's Scheme SCM with regex working on recent SuSE OSes

3. grep regex to ruby regex...

4. Regex++ or other Regex lib for Fortran?

5. Python regex / libc regex interactions

6. HTTP server in Scheme?

7. HTTP server in Scheme?

8. XML schema, SOAP, HTTP Post & HTTP Get

9. tcl http with HTTP-EQUIV="Refresh"

10. http package: Basic HTTP Authorization?

11. HTTP 1.0 and HTTP 1.1 packages

12. http package does not conform HTTP/1.0

 

 
Powered by phpBB® Forum Software