Folks, I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org. I feel like zope.org originally served as a place for you to try out zope and a place to learn about it. It gradually aquired a collaboration side with the fishbowl. Now I feel that zope.org's primary purposes are collaboration and education. The tryout feature has been largely surpassed by the free and for fee zope hosting that is availiable. How do you feel about it? -- ethan mindlace fremen zopatista community liason
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
It's relativley trivial to get a server setup on a local workstation to try DTML out on. I don't think putting DTML on zope.org is a huge priority.
Seconded ----- Original Message ----- From: "Steve Drees" <drees@the-bridge.net> To: <zope@zope.org> Sent: Monday, April 30, 2001 8:24 PM Subject: RE: [Zope] writing dtml on zope.org
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
It's relativley trivial to get a server setup on a local workstation to try DTML out on. I don't think putting DTML on zope.org is a huge priority.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi, I want to get the HTML result from a form into a dtml method. So I need a way to handle this result, but HOW. The form ist like this: <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form> If I klick on submit, I get the result displayed in the Browser, but I cannot work with it. Perhaps someone could help me??? Thanx a lot ... Marc
On Tue, 1 May 2001, Marc Fischer wrote:
Hi,
I want to get the HTML result from a form into a dtml method. So I need a way to handle this result, but HOW.
The form ist like this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
If I klick on submit, I get the result displayed in the Browser, but I cannot work with it. Perhaps someone could help me???
Hi, I think that, if you try <form action="http://server/the_method_you_want_to_call" method=POST> it will work. Paula
Hi, I think there was an understanding problem. I want to get the source code of the result that is displayed in the browser, after klicking on the submit button. I want to be able to handle this source perhabs to create a dtmlmethod wiht it, or do some string extractions with it.
-----Ursprungliche Nachricht----- Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] Gesendet: Dienstag, 1. Mai 2001 13:25 An: Marc Fischer Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
On Tue, 1 May 2001, Marc Fischer wrote:
Hi,
I want to get the HTML result from a form into a dtml method. So I need a way to handle this result, but HOW.
The form ist like this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
If I klick on submit, I get the result displayed in the Browser, but I cannot work with it. Perhaps someone could help me???
Hi,
I think that, if you try <form action="http://server/the_method_you_want_to_call" method=POST>
it will work.
Paula
Hi Marc, When you submit a form to one of your DTML methods or documents, all the form variables will be available without any further work to be done (REQUEST object, see docs). But if I get you right, you are not submitting your form to a method of your own. So things are a bit different here. As I understand it, you are submitting your form to someone else's server (since otherwise you would produce the output yourself). Maybe you're providing an input form that is directed to a search engine, or something similar. -------------------------------------------- <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type="text" name="myInput"> <input type=submit> </form> -------------------------------------------- If so, then you should take a look at the "KebasData" Product: http://www.zope.org/Members/kedai/KebasData Just instantiate a KebasData object, let's say "results". Take a look at the product's documentation to see how you can extract the relevant code from the external server's result page. I'll try to get you started right away: Set the regular expression patterns properly, start with .* as the search pattern and leave the rest blank ("url" will be set by a DTML method you create, see below), then you'll get the entire external page, you can change that later to fit your needs. Then create a DTML method next to it, lets say "getResults". It could look like this: <dtml-var standard_html_header> <h2>RESULTS</h3> <dtml-with results> <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> <dtml-call "get_matched(new_url)"> <dtml-in match> <dtml-var result><br/> </dtml-in> </dtml-with> <dtml-var standard_html_footer> This will fetch the page you want to display by calling "get_matched(new_url)", you construct that new_url dynamically, using your form variable "myInput". Then it iterates through the results list and spits out the parts that matched your query, appending a <br/> after each match (if you started with .* as the pattern, the list will only have one item, holding the complete page). Oh, right: your DTML method should have a proxy role that has the right to "change KebasData" (or maybe even "View management_screens"?) on the KebasData object "results", since it calls its function "get_matched", which is usually only called by clicking "Initialize!" in the management screen of the KebasData object. Now you just send your form to "getResults" (instead of the external server directly), and let your DTML method do the rest: -------------------------------------------- <form action="getResults" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type="text" name="myInput"> <input type=submit> </form> -------------------------------------------- Later, you could put the "getResults" code in a python script, then it's easier to do further processing with your fetched data. hth, Danny P.S.: Check the legal stuff before extracting other people's pages ;-)
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Marc Fischer Gesendet: Dienstag, 1. Mai 2001 11.43p An: Paula Mangas; Marc Fischer Cc: zope@zope.org Betreff: AW: [Zope] Source from form result.
Hi,
I think there was an understanding problem. I want to get the source code of the result that is displayed in the browser, after klicking on the submit button. I want to be able to handle this source perhabs to create a dtmlmethod wiht it, or do some string extractions with it.
-----Ursprungliche Nachricht----- Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] Gesendet: Dienstag, 1. Mai 2001 13:25 An: Marc Fischer Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
On Tue, 1 May 2001, Marc Fischer wrote:
Hi,
I want to get the HTML result from a form into a dtml method. So I need a way to handle this result, but HOW.
The form ist like this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
If I klick on submit, I get the result displayed in the Browser, but I cannot work with it. Perhaps someone could help me???
Hi,
I think that, if you try <form action="http://server/the_method_you_want_to_call" method=POST>
it will work.
Paula
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Danny, first of all thank you for your detailed help!!! That is nearly, what I am looking for, but one problem exists: The page I want to extract (you are right ... its on an external server) does not work with passing the variables in the url. I mean ... http://server?x=a&y=b does not work. I need to do it with a form like: <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form> That's my big big problem. Btw, ... its legal :-))) Marc
-----Ursprungliche Nachricht----- Von: Danny William Adair [mailto:Danny@Adair.net] Gesendet: Mittwoch, 2. Mai 2001 01:26 An: Marc Fischer; Paula Mangas Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
Hi Marc,
When you submit a form to one of your DTML methods or documents, all the form variables will be available without any further work to be done (REQUEST object, see docs). But if I get you right, you are not submitting your form to a method of your own. So things are a bit different here.
As I understand it, you are submitting your form to someone else's server (since otherwise you would produce the output yourself). Maybe you're providing an input form that is directed to a search engine, or something similar.
-------------------------------------------- <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
If so, then you should take a look at the "KebasData" Product: http://www.zope.org/Members/kedai/KebasData
Just instantiate a KebasData object, let's say "results". Take a look at the product's documentation to see how you can extract the relevant code from the external server's result page. I'll try to get you started right away:
Set the regular expression patterns properly, start with
.*
as the search pattern and leave the rest blank ("url" will be set by a DTML method you create, see below), then you'll get the entire external page, you can change that later to fit your needs.
Then create a DTML method next to it, lets say "getResults". It could look like this:
<dtml-var standard_html_header> <h2>RESULTS</h3> <dtml-with results> <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> <dtml-call "get_matched(new_url)"> <dtml-in match> <dtml-var result><br/> </dtml-in> </dtml-with> <dtml-var standard_html_footer>
This will fetch the page you want to display by calling "get_matched(new_url)", you construct that new_url dynamically, using your form variable "myInput". Then it iterates through the results list and spits out the parts that matched your query, appending a <br/> after each match (if you started with .* as the pattern, the list will only have one item, holding the complete page).
Oh, right: your DTML method should have a proxy role that has the right to "change KebasData" (or maybe even "View management_screens"?) on the KebasData object "results", since it calls its function "get_matched", which is usually only called by clicking "Initialize!" in the management screen of the KebasData object.
Now you just send your form to "getResults" (instead of the external server directly), and let your DTML method do the rest:
-------------------------------------------- <form action="getResults" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
Later, you could put the "getResults" code in a python script, then it's easier to do further processing with your fetched data.
hth, Danny
P.S.: Check the legal stuff before extracting other people's pages ;-)
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Marc Fischer Gesendet: Dienstag, 1. Mai 2001 11.43p An: Paula Mangas; Marc Fischer Cc: zope@zope.org Betreff: AW: [Zope] Source from form result.
Hi,
I think there was an understanding problem. I want to get the source code of the result that is displayed in the browser, after klicking on the submit button. I want to be able to handle this source perhabs to create a dtmlmethod wiht it, or do some string extractions with it.
-----Ursprungliche Nachricht----- Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] Gesendet: Dienstag, 1. Mai 2001 13:25 An: Marc Fischer Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
On Tue, 1 May 2001, Marc Fischer wrote:
Hi,
I want to get the HTML result from a form into a dtml method. So I need a way to handle this result, but HOW.
The form ist like this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
If I klick on submit, I get the result displayed in the Browser, but I cannot work with it. Perhaps someone could help me???
Hi,
I think that, if you try <form action="http://server/the_method_you_want_to_call" method=POST>
it will work.
Paula
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Marc, zope has a "client" deep in its core :) See lib/python/ZPublisher/Client.py for more info. I currently use a external method like this: from ZPublisher import Client def web_client(url = '', username = None, password = None, **kw): '''access http servers''' class gen_res: __allow_access_to_unprotected_subobjects__=1 f=gen_res() if kw: f.headers,f.body=Client.call(url,username,password,kw) else: f.headers,f.body=Client.call(url,username,password) return(f) And use it like this: <dtml-with "web_client('http://server/uri')"> <dtml-var body> </dtml-with> In Client.py are also methods and functions to map arguments to a POST request as you wish. I think, the above could be a starting point for you. HTH Tino Wildenhain --On Mittwoch, 2. Mai 2001 12:12 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Danny,
first of all thank you for your detailed help!!! That is nearly, what I am looking for, but one problem exists: The page I want to extract (you are right ... its on an external server) does not work with passing the variables in the url. I mean ...
http://server?x=a&y=b does not work.
I need to do it with a form like:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
That's my big big problem. Btw, ... its legal :-)))
Marc
-----Ursprungliche Nachricht----- Von: Danny William Adair [mailto:Danny@Adair.net] Gesendet: Mittwoch, 2. Mai 2001 01:26 An: Marc Fischer; Paula Mangas Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
Hi Marc,
When you submit a form to one of your DTML methods or documents, all the form variables will be available without any further work to be done (REQUEST object, see docs). But if I get you right, you are not submitting your form to a method of your own. So things are a bit different here.
As I understand it, you are submitting your form to someone else's server (since otherwise you would produce the output yourself). Maybe you're providing an input form that is directed to a search engine, or something similar.
-------------------------------------------- <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
If so, then you should take a look at the "KebasData" Product: http://www.zope.org/Members/kedai/KebasData
Just instantiate a KebasData object, let's say "results". Take a look at the product's documentation to see how you can extract the relevant code from the external server's result page. I'll try to get you started right away:
Set the regular expression patterns properly, start with
.*
as the search pattern and leave the rest blank ("url" will be set by a DTML method you create, see below), then you'll get the entire external page, you can change that later to fit your needs.
Then create a DTML method next to it, lets say "getResults". It could look like this:
<dtml-var standard_html_header> <h2>RESULTS</h3> <dtml-with results> <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> <dtml-call "get_matched(new_url)"> <dtml-in match> <dtml-var result><br/> </dtml-in> </dtml-with> <dtml-var standard_html_footer>
This will fetch the page you want to display by calling "get_matched(new_url)", you construct that new_url dynamically, using your form variable "myInput". Then it iterates through the results list and spits out the parts that matched your query, appending a <br/> after each match (if you started with .* as the pattern, the list will only have one item, holding the complete page).
Oh, right: your DTML method should have a proxy role that has the right to "change KebasData" (or maybe even "View management_screens"?) on the KebasData object "results", since it calls its function "get_matched", which is usually only called by clicking "Initialize!" in the management screen of the KebasData object.
Now you just send your form to "getResults" (instead of the external server directly), and let your DTML method do the rest:
-------------------------------------------- <form action="getResults" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
Later, you could put the "getResults" code in a python script, then it's easier to do further processing with your fetched data.
hth, Danny
P.S.: Check the legal stuff before extracting other people's pages ;-)
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Marc Fischer Gesendet: Dienstag, 1. Mai 2001 11.43p An: Paula Mangas; Marc Fischer Cc: zope@zope.org Betreff: AW: [Zope] Source from form result.
Hi,
I think there was an understanding problem. I want to get the source code of the result that is displayed in the browser, after klicking on the submit button. I want to be able to handle this source perhabs to create a dtmlmethod wiht it, or do some string extractions with it.
-----Ursprungliche Nachricht----- Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] Gesendet: Dienstag, 1. Mai 2001 13:25 An: Marc Fischer Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
On Tue, 1 May 2001, Marc Fischer wrote:
> Hi, > > I want to get the HTML result from a form into a dtml method. So I need a > way to handle this result, but HOW. > > The form ist like this: > > <form action="http://server" method=POST> > <input type=hidden name="x" value="a"> > <input type=hidden name="y" value="b"> > <input type=submit> > </form> > > If I klick on submit, I get the result displayed in the Browser, but I > cannot work with it. > Perhaps someone could help me???
Hi,
I think that, if you try <form action="http://server/the_method_you_want_to_call" method=POST>
it will work.
Paula
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Tino, I think, thats it, what I am looking for. Your Example works fine so far. But my understanding in python I so low, that I am not able change it in my needed way. Perhabs you could tell me how to realize this: <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form> and show me how to get the source of the result page?! :-) I would be very happy, ... thanx a lot ... Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Mittwoch, 2. Mai 2001 15:37 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: [Zope] Source from form result.
Hi Marc,
zope has a "client" deep in its core :) See lib/python/ZPublisher/Client.py for more info.
I currently use a external method like this:
from ZPublisher import Client
def web_client(url = '', username = None, password = None, **kw): '''access http servers''' class gen_res: __allow_access_to_unprotected_subobjects__=1 f=gen_res() if kw: f.headers,f.body=Client.call(url,username,password,kw) else: f.headers,f.body=Client.call(url,username,password) return(f)
And use it like this:
<dtml-with "web_client('http://server/uri')"> <dtml-var body> </dtml-with>
In Client.py are also methods and functions to map arguments to a POST request as you wish.
I think, the above could be a starting point for you.
HTH Tino Wildenhain
--On Mittwoch, 2. Mai 2001 12:12 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Danny,
first of all thank you for your detailed help!!! That is nearly, what I am looking for, but one problem exists: The page I want to extract (you are right ... its on an external server) does not work with passing the variables in the url. I mean ...
http://server?x=a&y=b does not work.
I need to do it with a form like:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
That's my big big problem. Btw, ... its legal :-)))
Marc
-----Ursprungliche Nachricht----- Von: Danny William Adair [mailto:Danny@Adair.net] Gesendet: Mittwoch, 2. Mai 2001 01:26 An: Marc Fischer; Paula Mangas Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
Hi Marc,
When you submit a form to one of your DTML methods or documents, all the form variables will be available without any further work to be done (REQUEST object, see docs). But if I get you right, you are not submitting your form to a method of your own. So things are a bit different here.
As I understand it, you are submitting your form to someone else's server (since otherwise you would produce the output yourself). Maybe you're providing an input form that is directed to a search engine, or something similar.
-------------------------------------------- <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
If so, then you should take a look at the "KebasData" Product: http://www.zope.org/Members/kedai/KebasData
Just instantiate a KebasData object, let's say "results". Take a look at the product's documentation to see how you can extract the relevant code from the external server's result page. I'll try to get you started right away:
Set the regular expression patterns properly, start with
.*
as the search pattern and leave the rest blank ("url" will be set by a DTML method you create, see below), then you'll get the entire external page, you can change that later to fit your needs.
Then create a DTML method next to it, lets say "getResults". It could look like this:
<dtml-var standard_html_header> <h2>RESULTS</h3> <dtml-with results> <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> <dtml-call "get_matched(new_url)"> <dtml-in match> <dtml-var result><br/> </dtml-in> </dtml-with> <dtml-var standard_html_footer>
This will fetch the page you want to display by calling "get_matched(new_url)", you construct that new_url dynamically, using your form variable "myInput". Then it iterates through the results list and spits out the parts that matched your query, appending a <br/> after each match (if you started with .* as the pattern, the list will only have one item, holding the complete page).
Oh, right: your DTML method should have a proxy role that has the right to "change KebasData" (or maybe even "View management_screens"?) on the KebasData object "results", since it calls its function "get_matched", which is usually only called by clicking "Initialize!" in the management screen of the KebasData object.
Now you just send your form to "getResults" (instead of the external server directly), and let your DTML method do the rest:
-------------------------------------------- <form action="getResults" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
Later, you could put the "getResults" code in a python script, then it's easier to do further processing with your fetched data.
hth, Danny
P.S.: Check the legal stuff before extracting other people's pages ;-)
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Marc Fischer Gesendet: Dienstag, 1. Mai 2001 11.43p An: Paula Mangas; Marc Fischer Cc: zope@zope.org Betreff: AW: [Zope] Source from form result.
Hi,
I think there was an understanding problem. I want to get the source code of the result that is displayed in the browser, after klicking on the submit button. I want to be able to handle this source perhabs to create a dtmlmethod wiht it, or do some string extractions with it.
> -----Ursprungliche Nachricht----- > Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] > Gesendet: Dienstag, 1. Mai 2001 13:25 > An: Marc Fischer > Cc: zope@zope.org > Betreff: Re: [Zope] Source from form result. > > > On Tue, 1 May 2001, Marc Fischer wrote: > > > Hi, > > > > I want to get the HTML result from a form into a dtml method. > So I need a > > way to handle this result, but HOW. > > > > The form ist like this: > > > > <form action="http://server" method=POST> > > <input type=hidden name="x" value="a"> > > <input type=hidden name="y" value="b"> > > <input type=submit> > > </form> > > > > If I klick on submit, I get the result displayed in the Browser, but I > > cannot work with it. > > Perhaps someone could help me??? > > > Hi, > > > I think that, if you try > <form action="http://server/the_method_you_want_to_call" method=POST> > > it will work. > > Paula >
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Marc, I think many people are uncertain about what you want to get. 1) You can get the "source" of the result page from the browser by using the "View/Source" menu or its equivalent on various browsers. This will show you the HTML that Zope has actually created and returned to the browser. 2) If you want to see the above page as text, rather than as rendered html, and you want to automatically see it in the browser window, then you have to change the content-type header from "text/html" (which it normally would be) to "text/plain". Some browsers might still render it as html, but chances are you will see it as text. To make the change, you modify the RESPONSE object. Someone else, please help out with the exact syntax for this, would you? 3) You can get the Zope "source" by using the Zope management interface. 4) A fourth possibility is that you want some other user, who has no access to the Zope mangement interface, to get the Zope source page that Zope calls - as opposed to the results page that Zope would ***generate***. I'm not sure how to do that, though I seem to remember that it's easy for a dtml method. Which of these possibilities do you want? Or is there another alternative that you want? Cheers, Tom P [Marc Fischer]
I think, thats it, what I am looking for. Your Example works fine so far. But my understanding in python I so low, that I am not able change it in
my
needed way. Perhabs you could tell me how to realize this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
and show me how to get the source of the result page?! :-)
I think many people are uncertain about what you want to get.
1) You can get the "source" of the result page from the browser by using the "View/Source" menu or its equivalent on various browsers. This will show you the HTML that Zope has actually created and returned to the browser.
2) If you want to see the above page as text, rather than as rendered html, and you want to automatically see it in the browser window, then you have to change the content-type header from "text/html" (which it normally would be) to "text/plain". Some browsers might still render it as html, but chances are you will see it as text. To make the change, you modify the RESPONSE object. Someone else, please help out with the exact syntax for this, would you?
3) You can get the Zope "source" by using the Zope management interface.
4) A fourth possibility is that you want some other user, who has no access to the Zope mangement interface, to get the Zope source page that Zope calls - as opposed to the results page that Zope would ***generate***. I'm not sure how to do that, though I seem to remember that it's easy for a dtml method.
Which of these possibilities do you want? Or is there another alternative that you want?
:-) Yes, there is an other :-)) Ok, I will try to explain. ... Somewhere in the Web, there is a Website, out of the world of zope:-), that provides a form with a submit button. this form passes some arguments with the syntax: <input type="hidden" name="x" value="y"> ... If you klick on submit button, you get displayed some pictures. so far so good ... I want to create a zope application, that automatically gets the source of this result page, extracts the urls of the picutres and finally uploads these pictures into my zopeserver. The problem is, that it is not possible to pass the variables in the url like this: http://server/index.html?x=y. So I am looking for a way of being able to handle the source code of this result. Extraction of the urls is not a problem. Thanks for your interest ... Marc
[Marc Fischer]
Ok, I will try to explain. ... Somewhere in the Web, there is a Website, out of the world of zope:-), that provides a form with a submit button. this form passes some arguments with the syntax: <input type="hidden" name="x" value="y"> ...
If you klick on submit button, you get displayed some pictures. so far so good ...
I want to create a zope application, that automatically gets the source of this result page, extracts the urls of the picutres and finally uploads these pictures into my zopeserver.
[Tom] You mean, you have a web page hosted in Zope, you click a button or something on it, and the pictures end up in Zope with no more human actions? [Marc]
The problem is, that it is not possible to pass the variables in the url like this: http://server/index.html?x=y.
[Tom] I don't know what you mean here, why can't you include the variables in the url? Where would you like to include the variables but find it can't be done? [Marc]
So I am looking for a way of being able to handle the source code of this result. Extraction of the urls is not a problem.
[Tom] Do you want to do this for a single site that always sends the same html, or a range of sites that are similar but not identical? I would think about using an External Method. That would let you use the Python httplib library. With httplib , you could get the form by issuing an HTTP GET command on the remote server. Then you could use the form to build the right url (including the "?x=y"), and then issue another GET on that url. This would get you the html for the page - that is the source you asked for - from which you could extract all the image urls. This wouldn't work if the form runs some javascript to set its variables, though, since your Python program wouldn't be able to figure out what the javascript was doing. Alternatively, if the form you want has a name assigned to the form element (or even if you knew its position among all the forms on the page), you could create a browser window with two frames and load the form into one of them. From the other one, using Javascript, you could cause the form to load the page that has the pictures. Then, again with javascript, you could walk through its images array and get all the urls. Then you could load these urls into form variables and, using javascript, send the form with the pictures' urls to Zope. From there, it ought to be possible to get Zope to upload the pictures. If you were clever with the design, you could get your page to do this on a list of sites, or on a list of picture selections. I think this would be feasible using either Netscape or Internet Explorer, but certainly with IE. We're talking about a lot of work experimenting and developing, though, if you don't know these techniques already. How many images do you want to capture? Maybe it would be faster to do them by hand, one at a time. Cheers, Tom P
[Marc Fischer]
Ok, I will try to explain. ... Somewhere in the Web, there is a Website, out of the world of zope:-), that provides a form with a submit button. this form passes some arguments with the syntax: <input type="hidden" name="x" value="y"> ...
If you klick on submit button, you get displayed some pictures. so far so good ...
I want to create a zope application, that automatically gets the source of this result page, extracts the urls of the picutres and finally uploads these pictures into my zopeserver.
[Tom] You mean, you have a web page hosted in Zope, you click a button or something on it, and the pictures end up in Zope with no more human actions?
NO, it is an external webpage!(NO ZOPE, not mine) There is a form with a submit button. If I submit, I get the result page. On this page are included pictures. I want the source code of this page, in order to extract the included picture urls, and automatically upload those pics in my ZOPE Server!
[Marc]
The problem is, that it is not possible to pass the variables in the url like this: http://server/index.html?x=y.
[Tom] I don't know what you mean here, why can't you include the variables in the url? Where would you like to include the variables but find it can't be done?
I don't know why. But the php script (on the external server) which is call by <form action="script.php" ... with the submit button, does not publish the same result, if I pass the variables over the url!
[Marc]
So I am looking for a way of being able to handle the source code of this result. Extraction of the urls is not a problem.
[Tom] Do you want to do this for a single site that always sends the same html, or a range of sites that are similar but not identical?
Just one single site!
I would think about using an External Method. That would let you use the Python httplib library. With httplib , you could get the form by issuing an HTTP GET command on the remote server. Then you could use the form to build the right url (including the "?x=y")
will not work ;-(
, and then issue another GET on that url. This would get you the html for the page - that is the source you asked for - from which you could extract all the image urls. This wouldn't work if the form runs some javascript to set its variables, though, since your Python program wouldn't be able to figure out what the javascript was doing.
Alternatively, if the form you want has a name assigned to the form element (or even if you knew its position among all the forms on the page), you could create a browser window with two frames and load the form into one of them. From the other one, using Javascript, you could cause the form to load the page that has the pictures. Then, again with javascript, you could walk through its images array and get all the urls. Then you could load these urls into form variables and, using javascript, send the form with the pictures' urls to Zope. From there, it ought to be possible to get Zope to upload the pictures.
that would be a possibility, if I dont have success in the more automatically way :-)
If you were clever with the design, you could get your page to do this on a list of sites, or on a list of picture selections.
I think this would be feasible using either Netscape or Internet Explorer, but certainly with IE.
We're talking about a lot of work experimenting and developing, though, if you don't know these techniques already. How many images do you want to capture? Maybe it would be faster to do them by hand, one at a time. Zope maillist - Zope@zope.org
We are talking about nearly 20 pictures, that change a few times a day. My script should be called a few times a day, too. New Pictures should automatically be inserted in my ZOPE. Marc
[Tom] I don't know what you mean here, why can't you include the variables in the url? Where would you like to include the variables but find it can't be done?
I don't know why. But the php script (on the external server) which is call by <form action="script.php" ... with the submit button, does not publish the same result, if I pass the variables over the url!
[Tom] Maybe they use the POST method instead. Look at the form in the page and see. You are looking for method='POST'. You can certainly POST from httplib if that's what it takes. In fact, why don't you give us the complete start tag for the form you are interested in, the one that would show you the pictures if you clicked on its submit button. Tom P
Hi Marc, as I told you already, the stuff in lib/python/ZPublisher/Client.py is probably what you want. There is a class "Function" which takes the following arguments: Fuction(url, arguments=(), method=None, username=None, password=None, timeout=None, **headers) In your example, method should be "POST" and arguments is a dictionary of key:value pairs. HTH Tino Wildenhain
:-) Yes, there is an other :-))
Ok, I will try to explain. ... Somewhere in the Web, there is a Website, out of the world of zope:-), that provides a form with a submit button. this form passes some arguments with the syntax: <input type="hidden" name="x" value="y"> ...
If you klick on submit button, you get displayed some pictures. so far so good ...
I want to create a zope application, that automatically gets the source of this result page, extracts the urls of the picutres and finally uploads these pictures into my zopeserver.
The problem is, that it is not possible to pass the variables in the url like this: http://server/index.html?x=y.
So I am looking for a way of being able to handle the source code of this result. Extraction of the urls is not a problem.
Thanks for your interest ...
Marc
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi all, I needed to be able to change the passwd of a current zope user to sync his passwords with my database. Is this possible ? I could provide an interface and user could confirm the new password and then i could also sync his UNIX password to the same !!! I am a newbie to both zope and python so i would need explicit instructions if there is a solution. thanks bobby
Hi Marc, its simply: <dtml-with "web_client('http://server/',x='a',y='b')"> <dtml-var body> </dtml-with> in your case :) x and y go into this **kw argument. If this is set, webclient uses POST. HTH Tino Wildenhain. --On Mittwoch, 2. Mai 2001 20:45 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Tino,
I think, thats it, what I am looking for. Your Example works fine so far. But my understanding in python I so low, that I am not able change it in my needed way. Perhabs you could tell me how to realize this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
and show me how to get the source of the result page?! :-)
I would be very happy, ... thanx a lot ...
Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Mittwoch, 2. Mai 2001 15:37 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: [Zope] Source from form result.
Hi Marc,
zope has a "client" deep in its core :) See lib/python/ZPublisher/Client.py for more info.
I currently use a external method like this:
from ZPublisher import Client
def web_client(url = '', username = None, password = None, **kw): '''access http servers''' class gen_res: __allow_access_to_unprotected_subobjects__=1 f=gen_res() if kw: f.headers,f.body=Client.call(url,username,password,kw) else: f.headers,f.body=Client.call(url,username,password) return(f)
And use it like this:
<dtml-with "web_client('http://server/uri')"> <dtml-var body> </dtml-with>
In Client.py are also methods and functions to map arguments to a POST request as you wish.
I think, the above could be a starting point for you.
HTH Tino Wildenhain
--On Mittwoch, 2. Mai 2001 12:12 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Danny,
first of all thank you for your detailed help!!! That is nearly, what I am looking for, but one problem exists: The page I want to extract (you are right ... its on an external server) does not work with passing the variables in the url. I mean ...
http://server?x=a&y=b does not work.
I need to do it with a form like:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
That's my big big problem. Btw, ... its legal :-)))
Marc
-----Ursprungliche Nachricht----- Von: Danny William Adair [mailto:Danny@Adair.net] Gesendet: Mittwoch, 2. Mai 2001 01:26 An: Marc Fischer; Paula Mangas Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
Hi Marc,
When you submit a form to one of your DTML methods or documents, all the form variables will be available without any further work to be done (REQUEST object, see docs). But if I get you right, you are not submitting your form to a method of your own. So things are a bit different here.
As I understand it, you are submitting your form to someone else's server (since otherwise you would produce the output yourself). Maybe you're providing an input form that is directed to a search engine, or something similar.
-------------------------------------------- <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
If so, then you should take a look at the "KebasData" Product: http://www.zope.org/Members/kedai/KebasData
Just instantiate a KebasData object, let's say "results". Take a look at the product's documentation to see how you can extract the relevant code from the external server's result page. I'll try to get you started right away:
Set the regular expression patterns properly, start with
.*
as the search pattern and leave the rest blank ("url" will be set by a DTML method you create, see below), then you'll get the entire external page, you can change that later to fit your needs.
Then create a DTML method next to it, lets say "getResults". It could look like this:
<dtml-var standard_html_header> <h2>RESULTS</h3> <dtml-with results> <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> <dtml-call "get_matched(new_url)"> <dtml-in match> <dtml-var result><br/> </dtml-in> </dtml-with> <dtml-var standard_html_footer>
This will fetch the page you want to display by calling "get_matched(new_url)", you construct that new_url dynamically, using your form variable "myInput". Then it iterates through the results list and spits out the parts that matched your query, appending a <br/> after each match (if you started with .* as the pattern, the list will only have one item, holding the complete page).
Oh, right: your DTML method should have a proxy role that has the right to "change KebasData" (or maybe even "View management_screens"?) on the KebasData object "results", since it calls its function "get_matched", which is usually only called by clicking "Initialize!" in the management screen of the KebasData object.
Now you just send your form to "getResults" (instead of the external server directly), and let your DTML method do the rest:
-------------------------------------------- <form action="getResults" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
Later, you could put the "getResults" code in a python script, then it's easier to do further processing with your fetched data.
hth, Danny
P.S.: Check the legal stuff before extracting other people's pages ;-)
> -----Ursprungliche Nachricht----- > Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Marc > Fischer > Gesendet: Dienstag, 1. Mai 2001 11.43p > An: Paula Mangas; Marc Fischer > Cc: zope@zope.org > Betreff: AW: [Zope] Source from form result. > > > Hi, > > I think there was an understanding problem. I want to get the > source code of > the result that is displayed in the browser, after klicking on > the submit > button. I want to be able to handle this source perhabs to create > a dtmlmethod wiht it, or do some string extractions with it. > > > > > -----Ursprungliche Nachricht----- > > Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] > > Gesendet: Dienstag, 1. Mai 2001 13:25 > > An: Marc Fischer > > Cc: zope@zope.org > > Betreff: Re: [Zope] Source from form result. > > > > > > On Tue, 1 May 2001, Marc Fischer wrote: > > > > > Hi, > > > > > > I want to get the HTML result from a form into a dtml method. > > So I need a > > > way to handle this result, but HOW. > > > > > > The form ist like this: > > > > > > <form action="http://server" method=POST> > > > <input type=hidden name="x" value="a"> > > > <input type=hidden name="y" value="b"> > > > <input type=submit> > > > </form> > > > > > > If I klick on submit, I get the result displayed in the > Browser, but I > > > cannot work with it. > > > Perhaps someone could help me??? > > > > > > Hi, > > > > > > I think that, if you try > > <form action="http://server/the_method_you_want_to_call" method=POST> > > > > it will work. > > > > Paula > > > > > _______________________________________________ > Zope maillist - Zope@zope.org > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) >
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hey, thanks to all of you, that tried to help me. Finally I had success with the httplib funktion. ... :-))) Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Donnerstag, 3. Mai 2001 22:51 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: AW: [Zope] Source from form result.
Hi Marc,
its simply:
<dtml-with "web_client('http://server/',x='a',y='b')"> <dtml-var body> </dtml-with>
in your case :) x and y go into this **kw argument. If this is set, webclient uses POST.
HTH Tino Wildenhain.
--On Mittwoch, 2. Mai 2001 20:45 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Tino,
I think, thats it, what I am looking for. Your Example works fine so far. But my understanding in python I so low, that I am not able change it in my needed way. Perhabs you could tell me how to realize this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
and show me how to get the source of the result page?! :-)
I would be very happy, ... thanx a lot ...
Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Mittwoch, 2. Mai 2001 15:37 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: [Zope] Source from form result.
Hi Marc,
zope has a "client" deep in its core :) See lib/python/ZPublisher/Client.py for more info.
I currently use a external method like this:
from ZPublisher import Client
def web_client(url = '', username = None, password = None, **kw): '''access http servers''' class gen_res: __allow_access_to_unprotected_subobjects__=1 f=gen_res() if kw: f.headers,f.body=Client.call(url,username,password,kw) else: f.headers,f.body=Client.call(url,username,password) return(f)
And use it like this:
<dtml-with "web_client('http://server/uri')"> <dtml-var body> </dtml-with>
In Client.py are also methods and functions to map arguments to a POST request as you wish.
I think, the above could be a starting point for you.
HTH Tino Wildenhain
--On Mittwoch, 2. Mai 2001 12:12 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Danny,
first of all thank you for your detailed help!!! That is nearly, what I am looking for, but one problem exists: The page I want to extract (you are right ... its on an external server) does not work with passing the variables in the url. I mean ...
http://server?x=a&y=b does not work.
I need to do it with a form like:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
That's my big big problem. Btw, ... its legal :-)))
Marc
-----Ursprungliche Nachricht----- Von: Danny William Adair [mailto:Danny@Adair.net] Gesendet: Mittwoch, 2. Mai 2001 01:26 An: Marc Fischer; Paula Mangas Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
Hi Marc,
When you submit a form to one of your DTML methods or documents, all the form variables will be available without any further work to be done (REQUEST object, see docs). But if I get you right, you are not submitting your form to a method of your own. So things are a bit different here.
As I understand it, you are submitting your form to someone else's server (since otherwise you would produce the output yourself). Maybe you're providing an input form that is directed to a search engine, or something similar.
-------------------------------------------- <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
If so, then you should take a look at the "KebasData" Product: http://www.zope.org/Members/kedai/KebasData
Just instantiate a KebasData object, let's say "results". Take a look at the product's documentation to see how you can extract the relevant code from the external server's result page. I'll try to get you started right away:
Set the regular expression patterns properly, start with
.*
as the search pattern and leave the rest blank ("url" will be set by a DTML method you create, see below), then you'll get the entire external page, you can change that later to fit your needs.
Then create a DTML method next to it, lets say "getResults". It could look like this:
<dtml-var standard_html_header> <h2>RESULTS</h3> <dtml-with results> <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> <dtml-call "get_matched(new_url)"> <dtml-in match> <dtml-var result><br/> </dtml-in> </dtml-with> <dtml-var standard_html_footer>
This will fetch the page you want to display by calling "get_matched(new_url)", you construct that new_url dynamically, using your form variable "myInput". Then it iterates through the results list and spits out the parts that matched your query, appending a <br/> after each match (if you started with .* as the pattern, the list will only have one item, holding the complete page).
Oh, right: your DTML method should have a proxy role that has the right to "change KebasData" (or maybe even "View management_screens"?) on the KebasData object "results", since it calls its function "get_matched", which is usually only called by clicking "Initialize!" in the management screen of the KebasData object.
Now you just send your form to "getResults" (instead of the external server directly), and let your DTML method do the rest:
-------------------------------------------- <form action="getResults" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
Later, you could put the "getResults" code in a python script, then it's easier to do further processing with your fetched data.
hth, Danny
P.S.: Check the legal stuff before extracting other people's pages ;-)
>> -----Ursprungliche Nachricht----- >> Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Marc >> Fischer >> Gesendet: Dienstag, 1. Mai 2001 11.43p >> An: Paula Mangas; Marc Fischer >> Cc: zope@zope.org >> Betreff: AW: [Zope] Source from form result. >> >> >> Hi, >> >> I think there was an understanding problem. I want to get the >> source code of >> the result that is displayed in the browser, after klicking on >> the submit >> button. I want to be able to handle this source perhabs to create >> a dtmlmethod wiht it, or do some string extractions with it. >> >> >> >> > -----Ursprungliche Nachricht----- >> > Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] >> > Gesendet: Dienstag, 1. Mai 2001 13:25 >> > An: Marc Fischer >> > Cc: zope@zope.org >> > Betreff: Re: [Zope] Source from form result. >> > >> > >> > On Tue, 1 May 2001, Marc Fischer wrote: >> > >> > > Hi, >> > > >> > > I want to get the HTML result from a form into a dtml method. >> > So I need a >> > > way to handle this result, but HOW. >> > > >> > > The form ist like this: >> > > >> > > <form action="http://server" method=POST> >> > > <input type=hidden name="x" value="a"> >> > > <input type=hidden name="y" value="b"> >> > > <input type=submit> >> > > </form> >> > > >> > > If I klick on submit, I get the result displayed in the >> Browser, but I >> > > cannot work with it. >> > > Perhaps someone could help me??? >> > >> > >> > Hi, >> > >> > >> > I think that, if you try >> > <form action="http://server/the_method_you_want_to_call" method=POST> >> > >> > it will work. >> > >> > Paula >> > >> >> >> _______________________________________________ >> Zope maillist - Zope@zope.org >> http://lists.zope.org/mailman/listinfo/zope >> ** No cross posts or HTML encoding! ** >> (Related lists - >> http://lists.zope.org/mailman/listinfo/zope-announce >> http://lists.zope.org/mailman/listinfo/zope-dev ) >>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Did you get enough new material to write a HowTo? "How To Screen Scrape" -- Loren
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Marc Fischer Sent: Thursday, May 03, 2001 16:31 To: Tino Wildenhain; Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Subject: AW: AW: AW: [Zope] Source from form result.
Hey, thanks to all of you, that tried to help me.
Finally I had success with the httplib funktion. ... :-)))
Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Donnerstag, 3. Mai 2001 22:51 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: AW: [Zope] Source from form result.
Hi Marc,
its simply:
<dtml-with "web_client('http://server/',x='a',y='b')"> <dtml-var body> </dtml-with>
in your case :) x and y go into this **kw argument. If this is set, webclient uses POST.
HTH Tino Wildenhain.
--On Mittwoch, 2. Mai 2001 20:45 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Tino,
I think, thats it, what I am looking for. Your Example works fine so far. But my understanding in python I so low, that I am not able change it in my needed way. Perhabs you could tell me how to realize this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
and show me how to get the source of the result page?! :-)
I would be very happy, ... thanx a lot ...
Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Mittwoch, 2. Mai 2001 15:37 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: [Zope] Source from form result.
Hi Marc,
zope has a "client" deep in its core :) See lib/python/ZPublisher/Client.py for more info.
I currently use a external method like this:
from ZPublisher import Client
def web_client(url = '', username = None, password = None, **kw): '''access http servers''' class gen_res: __allow_access_to_unprotected_subobjects__=1 f=gen_res() if kw: f.headers,f.body=Client.call(url,username,password,kw) else: f.headers,f.body=Client.call(url,username,password) return(f)
And use it like this:
<dtml-with "web_client('http://server/uri')"> <dtml-var body> </dtml-with>
In Client.py are also methods and functions to map arguments to a POST request as you wish.
I think, the above could be a starting point for you.
HTH Tino Wildenhain
--On Mittwoch, 2. Mai 2001 12:12 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Danny,
first of all thank you for your detailed help!!! That is nearly, what I am looking for, but one problem exists: The page I want to extract (you are right ... its on an external server) does not work with passing the variables in the url. I mean ...
http://server?x=a&y=b does not work.
I need to do it with a form like:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
That's my big big problem. Btw, ... its legal :-)))
Marc
-----Ursprungliche Nachricht----- Von: Danny William Adair [mailto:Danny@Adair.net] Gesendet: Mittwoch, 2. Mai 2001 01:26 An: Marc Fischer; Paula Mangas Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
Hi Marc,
When you submit a form to one of your DTML methods or documents, all the form variables will be available without any further work to be done (REQUEST object, see docs). But if I get you right, you are not submitting your form to a method of your own. So things are a bit different here.
As I understand it, you are submitting your form to someone else's server (since otherwise you would produce the output yourself). Maybe you're providing an input form that is directed to a search engine, or something similar.
-------------------------------------------- <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
If so, then you should take a look at the "KebasData" Product: http://www.zope.org/Members/kedai/KebasData
Just instantiate a KebasData object, let's say "results". Take a look at the product's documentation to see how you can extract the relevant code from the external server's result page. I'll try to get you started right away:
Set the regular expression patterns properly, start with
.*
as the search pattern and leave the rest blank ("url" will be set by a DTML method you create, see below), then you'll get the entire external page, you can change that later to fit your needs.
Then create a DTML method next to it, lets say "getResults". It could look like this:
<dtml-var standard_html_header> <h2>RESULTS</h3> <dtml-with results> <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> <dtml-call "get_matched(new_url)"> <dtml-in match> <dtml-var result><br/> </dtml-in> </dtml-with> <dtml-var standard_html_footer>
This will fetch the page you want to display by calling "get_matched(new_url)", you construct that new_url dynamically, using your form variable "myInput". Then it iterates through the results list and spits out the parts that matched your query, appending a <br/> after each match (if you started with .* as the pattern, the list will only have one item, holding the complete page).
Oh, right: your DTML method should have a proxy role that has the right to "change KebasData" (or maybe even "View management_screens"?) on the KebasData object "results", since it calls its function "get_matched", which is usually only called by clicking "Initialize!" in the management screen of the KebasData object.
Now you just send your form to "getResults" (instead of the external server directly), and let your DTML method do the rest:
-------------------------------------------- <form action="getResults" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
Later, you could put the "getResults" code in a python script, then it's easier to do further processing with your fetched data.
hth, Danny
P.S.: Check the legal stuff before extracting other people's pages ;-)
>>> -----Ursprungliche Nachricht----- >>> Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Marc >>> Fischer >>> Gesendet: Dienstag, 1. Mai 2001 11.43p >>> An: Paula Mangas; Marc Fischer >>> Cc: zope@zope.org >>> Betreff: AW: [Zope] Source from form result. >>> >>> >>> Hi, >>> >>> I think there was an understanding problem. I want to get the >>> source code of >>> the result that is displayed in the browser, after klicking on >>> the submit >>> button. I want to be able to handle this source perhabs to create >>> a dtmlmethod wiht it, or do some string extractions with it. >>> >>> >>> >>> > -----Ursprungliche Nachricht----- >>> > Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] >>> > Gesendet: Dienstag, 1. Mai 2001 13:25 >>> > An: Marc Fischer >>> > Cc: zope@zope.org >>> > Betreff: Re: [Zope] Source from form result. >>> > >>> > >>> > On Tue, 1 May 2001, Marc Fischer wrote: >>> > >>> > > Hi, >>> > > >>> > > I want to get the HTML result from a form into a dtml method. >>> > So I need a >>> > > way to handle this result, but HOW. >>> > > >>> > > The form ist like this: >>> > > >>> > > <form action="http://server" method=POST> >>> > > <input type=hidden name="x" value="a"> >>> > > <input type=hidden name="y" value="b"> >>> > > <input type=submit> >>> > > </form> >>> > > >>> > > If I klick on submit, I get the result displayed in the >>> Browser, but I >>> > > cannot work with it. >>> > > Perhaps someone could help me??? >>> > >>> > >>> > Hi, >>> > >>> > >>> > I think that, if you try >>> > <form action="http://server/the_method_you_want_to_call" method=POST> >>> > >>> > it will work. >>> > >>> > Paula >>> > >>> >>> >>> _______________________________________________ >>> Zope maillist - Zope@zope.org >>> http://lists.zope.org/mailman/listinfo/zope >>> ** No cross posts or HTML encoding! ** >>> (Related lists - >>> http://lists.zope.org/mailman/listinfo/zope-announce >>> http://lists.zope.org/mailman/listinfo/zope-dev ) >>>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Did you get enough new material to write a HowTo? "How To Screen Scrape"
-- Loren
I could. But what do you mean with "Screen Scrape" ??? Marc
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Marc Fischer Sent: Thursday, May 03, 2001 16:31 To: Tino Wildenhain; Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Subject: AW: AW: AW: [Zope] Source from form result.
Hey, thanks to all of you, that tried to help me.
Finally I had success with the httplib funktion. ... :-)))
Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Donnerstag, 3. Mai 2001 22:51 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: AW: [Zope] Source from form result.
Hi Marc,
its simply:
<dtml-with "web_client('http://server/',x='a',y='b')"> <dtml-var body> </dtml-with>
in your case :) x and y go into this **kw argument. If this is set, webclient uses POST.
HTH Tino Wildenhain.
--On Mittwoch, 2. Mai 2001 20:45 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Tino,
I think, thats it, what I am looking for. Your Example works fine so far. But my understanding in python I so low, that I am not able change it in my needed way. Perhabs you could tell me how to realize this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
and show me how to get the source of the result page?! :-)
I would be very happy, ... thanx a lot ...
Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Mittwoch, 2. Mai 2001 15:37 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: [Zope] Source from form result.
Hi Marc,
zope has a "client" deep in its core :) See lib/python/ZPublisher/Client.py for more info.
I currently use a external method like this:
from ZPublisher import Client
def web_client(url = '', username = None, password = None, **kw): '''access http servers''' class gen_res: __allow_access_to_unprotected_subobjects__=1 f=gen_res() if kw: f.headers,f.body=Client.call(url,username,password,kw) else: f.headers,f.body=Client.call(url,username,password) return(f)
And use it like this:
<dtml-with "web_client('http://server/uri')"> <dtml-var body> </dtml-with>
In Client.py are also methods and functions to map arguments to a POST request as you wish.
I think, the above could be a starting point for you.
HTH Tino Wildenhain
--On Mittwoch, 2. Mai 2001 12:12 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Danny,
first of all thank you for your detailed help!!! That is nearly, what I am looking for, but one problem exists: The page I want to extract (you are right ... its on an external server) does not work with passing the variables in the url. I mean ...
http://server?x=a&y=b does not work.
I need to do it with a form like:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
That's my big big problem. Btw, ... its legal :-)))
Marc
> -----Ursprungliche Nachricht----- > Von: Danny William Adair [mailto:Danny@Adair.net] > Gesendet: Mittwoch, 2. Mai 2001 01:26 > An: Marc Fischer; Paula Mangas > Cc: zope@zope.org > Betreff: Re: [Zope] Source from form result. > > > Hi Marc, > > When you submit a form to one of your DTML methods or documents, all the > form variables will be available without any further work to be done > (REQUEST object, see docs). But if I get you right, you are not > submitting your form to a method of your own. So things are a bit > different here. > > As I understand it, you are submitting your form to someone else's server > (since otherwise you would produce the output yourself). Maybe you're > providing an input form that is directed to a search engine, or something > similar. > > -------------------------------------------- > <form action="http://server" method=POST> > <input type=hidden name="x" value="a"> > <input type=hidden name="y" value="b"> > > <input type="text" name="myInput"> > > <input type=submit> > </form> > -------------------------------------------- > > If so, then you should take a look at the "KebasData" Product: > http://www.zope.org/Members/kedai/KebasData > > Just instantiate a KebasData object, let's say "results". Take a > look at the > product's documentation to see how you can extract the relevant code from > the external server's result page. I'll try to get you started right > away: > > Set the regular expression patterns properly, start with > > .* > > as the search pattern and leave the rest blank ("url" will be set > by a DTML > method you create, see below), then you'll get the entire > external page, you > can change that later to fit your needs. > > Then create a DTML method next to it, lets say "getResults". It could > look like this: > > <dtml-var standard_html_header> > <h2>RESULTS</h3> > <dtml-with results> > <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> > <dtml-call "get_matched(new_url)"> > <dtml-in match> > <dtml-var result><br/> > </dtml-in> > </dtml-with> > <dtml-var standard_html_footer> > > This will fetch the page you want to display by calling > "get_matched(new_url)", you construct that new_url dynamically, using > your form variable "myInput". Then it iterates through the results > list and spits > out the parts that matched your query, appending a <br/> after each match > (if you started with .* as the pattern, the list will only have one item, > holding the complete page). > > Oh, right: your DTML method should have a proxy role that has the > right to "change KebasData" (or maybe even "View > management_screens"?) on the KebasData object "results", since it > calls its function > "get_matched", which > is usually only called by clicking "Initialize!" in the > management screen of > the KebasData object. > > Now you just send your form to "getResults" (instead of the > external server > directly), and let your DTML method do the rest: > > -------------------------------------------- > <form action="getResults" method=POST> > <input type=hidden name="x" value="a"> > <input type=hidden name="y" value="b"> > > <input type="text" name="myInput"> > > <input type=submit> > </form> > -------------------------------------------- > > Later, you could put the "getResults" code in a python script, then it's > easier to do further processing with your fetched data. > > hth, > Danny > > P.S.: Check the legal stuff before extracting other people's pages ;-) > > >>> -----Ursprungliche Nachricht----- > >>> Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im > Auftrag von Marc > >>> Fischer > >>> Gesendet: Dienstag, 1. Mai 2001 11.43p > >>> An: Paula Mangas; Marc Fischer > >>> Cc: zope@zope.org > >>> Betreff: AW: [Zope] Source from form result. > >>> > >>> > >>> Hi, > >>> > >>> I think there was an understanding problem. I want to get the > >>> source code of > >>> the result that is displayed in the browser, after klicking on > >>> the submit > >>> button. I want to be able to handle this source perhabs to create > >>> a dtmlmethod wiht it, or do some string extractions with it. > >>> > >>> > >>> > >>> > -----Ursprungliche Nachricht----- > >>> > Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] > >>> > Gesendet: Dienstag, 1. Mai 2001 13:25 > >>> > An: Marc Fischer > >>> > Cc: zope@zope.org > >>> > Betreff: Re: [Zope] Source from form result. > >>> > > >>> > > >>> > On Tue, 1 May 2001, Marc Fischer wrote: > >>> > > >>> > > Hi, > >>> > > > >>> > > I want to get the HTML result from a form into a dtml method. > >>> > So I need a > >>> > > way to handle this result, but HOW. > >>> > > > >>> > > The form ist like this: > >>> > > > >>> > > <form action="http://server" method=POST> > >>> > > <input type=hidden name="x" value="a"> > >>> > > <input type=hidden name="y" value="b"> > >>> > > <input type=submit> > >>> > > </form> > >>> > > > >>> > > If I klick on submit, I get the result displayed in the > >>> Browser, but I > >>> > > cannot work with it. > >>> > > Perhaps someone could help me??? > >>> > > >>> > > >>> > Hi, > >>> > > >>> > > >>> > I think that, if you try > >>> > <form action="http://server/the_method_you_want_to_call" > method=POST> > >>> > > >>> > it will work. > >>> > > >>> > Paula > >>> > > >>> > >>> > >>> _______________________________________________ > >>> Zope maillist - Zope@zope.org > >>> http://lists.zope.org/mailman/listinfo/zope > >>> ** No cross posts or HTML encoding! ** > >>> (Related lists - > >>> http://lists.zope.org/mailman/listinfo/zope-announce > >>> http://lists.zope.org/mailman/listinfo/zope-dev ) > >>> >
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
A term I've heard other developers use for the practice of extracting data from a foreign system by capturing ("scraping") data from it's "screen" displays instead of from well-defined interfaces. -- Loren
-----Original Message----- From: Marc Fischer [mailto:marcbpc@gmx.de] Sent: Friday, May 04, 2001 01:50 To: Loren Stafford; Marc Fischer Cc: zope@zope.org Subject: AW: AW: AW: [Zope] Source from form result.
Did you get enough new material to write a HowTo? "How To Screen Scrape"
-- Loren
I could. But what do you mean with "Screen Scrape" ???
Marc
Hi Marc, so you had definitively more work then with ZClient ;) But nice to hear you have it working now ;) Regards Tino --On Freitag, 4. Mai 2001 01:30 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hey, thanks to all of you, that tried to help me.
Finally I had success with the httplib funktion. ... :-)))
Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Donnerstag, 3. Mai 2001 22:51 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: AW: [Zope] Source from form result.
Hi Marc,
its simply:
<dtml-with "web_client('http://server/',x='a',y='b')"> <dtml-var body> </dtml-with>
in your case :) x and y go into this **kw argument. If this is set, webclient uses POST.
HTH Tino Wildenhain.
--On Mittwoch, 2. Mai 2001 20:45 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Tino,
I think, thats it, what I am looking for. Your Example works fine so far. But my understanding in python I so low, that I am not able change it in my needed way. Perhabs you could tell me how to realize this:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
and show me how to get the source of the result page?! :-)
I would be very happy, ... thanx a lot ...
Marc
-----Ursprungliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Tino Wildenhain Gesendet: Mittwoch, 2. Mai 2001 15:37 An: Marc Fischer; Danny William Adair; Paula Mangas Cc: zope@zope.org Betreff: Re: AW: [Zope] Source from form result.
Hi Marc,
zope has a "client" deep in its core :) See lib/python/ZPublisher/Client.py for more info.
I currently use a external method like this:
from ZPublisher import Client
def web_client(url = '', username = None, password = None, **kw): '''access http servers''' class gen_res: __allow_access_to_unprotected_subobjects__=1 f=gen_res() if kw: f.headers,f.body=Client.call(url,username,password,kw) else: f.headers,f.body=Client.call(url,username,password) return(f)
And use it like this:
<dtml-with "web_client('http://server/uri')"> <dtml-var body> </dtml-with>
In Client.py are also methods and functions to map arguments to a POST request as you wish.
I think, the above could be a starting point for you.
HTH Tino Wildenhain
--On Mittwoch, 2. Mai 2001 12:12 +0200 Marc Fischer <marcbpc@gmx.de> wrote:
Hi Danny,
first of all thank you for your detailed help!!! That is nearly, what I am looking for, but one problem exists: The page I want to extract (you are right ... its on an external server) does not work with passing the variables in the url. I mean ...
http://server?x=a&y=b does not work.
I need to do it with a form like:
<form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b"> <input type=submit> </form>
That's my big big problem. Btw, ... its legal :-)))
Marc
-----Ursprungliche Nachricht----- Von: Danny William Adair [mailto:Danny@Adair.net] Gesendet: Mittwoch, 2. Mai 2001 01:26 An: Marc Fischer; Paula Mangas Cc: zope@zope.org Betreff: Re: [Zope] Source from form result.
Hi Marc,
When you submit a form to one of your DTML methods or documents, all the form variables will be available without any further work to be done (REQUEST object, see docs). But if I get you right, you are not submitting your form to a method of your own. So things are a bit different here.
As I understand it, you are submitting your form to someone else's server (since otherwise you would produce the output yourself). Maybe you're providing an input form that is directed to a search engine, or something similar.
-------------------------------------------- <form action="http://server" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
If so, then you should take a look at the "KebasData" Product: http://www.zope.org/Members/kedai/KebasData
Just instantiate a KebasData object, let's say "results". Take a look at the product's documentation to see how you can extract the relevant code from the external server's result page. I'll try to get you started right away:
Set the regular expression patterns properly, start with
.*
as the search pattern and leave the rest blank ("url" will be set by a DTML method you create, see below), then you'll get the entire external page, you can change that later to fit your needs.
Then create a DTML method next to it, lets say "getResults". It could look like this:
<dtml-var standard_html_header> <h2>RESULTS</h3> <dtml-with results> <dtml-call "REQUEST.set('new_url', 'http://server?search=' + myInput)"> <dtml-call "get_matched(new_url)"> <dtml-in match> <dtml-var result><br/> </dtml-in> </dtml-with> <dtml-var standard_html_footer>
This will fetch the page you want to display by calling "get_matched(new_url)", you construct that new_url dynamically, using your form variable "myInput". Then it iterates through the results list and spits out the parts that matched your query, appending a <br/> after each match (if you started with .* as the pattern, the list will only have one item, holding the complete page).
Oh, right: your DTML method should have a proxy role that has the right to "change KebasData" (or maybe even "View management_screens"?) on the KebasData object "results", since it calls its function "get_matched", which is usually only called by clicking "Initialize!" in the management screen of the KebasData object.
Now you just send your form to "getResults" (instead of the external server directly), and let your DTML method do the rest:
-------------------------------------------- <form action="getResults" method=POST> <input type=hidden name="x" value="a"> <input type=hidden name="y" value="b">
<input type="text" name="myInput">
<input type=submit> </form> --------------------------------------------
Later, you could put the "getResults" code in a python script, then it's easier to do further processing with your fetched data.
hth, Danny
P.S.: Check the legal stuff before extracting other people's pages ;-)
>>> -----Ursprungliche Nachricht----- >>> Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Marc >>> Fischer >>> Gesendet: Dienstag, 1. Mai 2001 11.43p >>> An: Paula Mangas; Marc Fischer >>> Cc: zope@zope.org >>> Betreff: AW: [Zope] Source from form result. >>> >>> >>> Hi, >>> >>> I think there was an understanding problem. I want to get the >>> source code of >>> the result that is displayed in the browser, after klicking on >>> the submit >>> button. I want to be able to handle this source perhabs to create >>> a dtmlmethod wiht it, or do some string extractions with it. >>> >>> >>> >>> > -----Ursprungliche Nachricht----- >>> > Von: Paula Mangas [mailto:pamm@students.si.fct.unl.pt] >>> > Gesendet: Dienstag, 1. Mai 2001 13:25 >>> > An: Marc Fischer >>> > Cc: zope@zope.org >>> > Betreff: Re: [Zope] Source from form result. >>> > >>> > >>> > On Tue, 1 May 2001, Marc Fischer wrote: >>> > >>> > > Hi, >>> > > >>> > > I want to get the HTML result from a form into a dtml method. >>> > So I need a >>> > > way to handle this result, but HOW. >>> > > >>> > > The form ist like this: >>> > > >>> > > <form action="http://server" method=POST> >>> > > <input type=hidden name="x" value="a"> >>> > > <input type=hidden name="y" value="b"> >>> > > <input type=submit> >>> > > </form> >>> > > >>> > > If I klick on submit, I get the result displayed in the >>> Browser, but I >>> > > cannot work with it. >>> > > Perhaps someone could help me??? >>> > >>> > >>> > Hi, >>> > >>> > >>> > I think that, if you try >>> > <form action="http://server/the_method_you_want_to_call" method=POST> >>> > >>> > it will work. >>> > >>> > Paula >>> > >>> >>> >>> _______________________________________________ >>> Zope maillist - Zope@zope.org >>> http://lists.zope.org/mailman/listinfo/zope >>> ** No cross posts or HTML encoding! ** >>> (Related lists - >>> http://lists.zope.org/mailman/listinfo/zope-announce >>> http://lists.zope.org/mailman/listinfo/zope-dev ) >>>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
<dtml-var expr="standard_newbie_disclaimer"> Your product has started me in the right direction, but I wonder if you could answer a question for me. I created the User Friendly sample (and named the object "userFriendly") and the display method (named "show"), and everything worked as expected. But if I call userFriendly from another DTML method with <dtml-var expr="userFriendly">, it just returns something like <KebasData instance at 89e0458>. Is there a way to call KebasData objects from DTML methods? I would like to be able to use multiple KebasData objects on the same page. Thanks. Russell Keppner On Thursday 19 April 2001 10:04 am, bak (kedai) wrote:
hello i'm not sure whether this is a proper thing to do, but here goes
i jsut made myself a python product that grabs a page, and return a list of items; depending on a few regular expression patterns.
any kind soul could spare a few minutes to look and comment on my codes? what i missed out, what should be done, etc
http://www.kedai.com.my/dll/KebasData.tar.gz tia
p/s - no docs as yet since this is still in testing phase
On Wednesday 02 May 2001 23:30, Russell Keppner wrote:
<dtml-var expr="standard_newbie_disclaimer">
Your product has started me in the right direction, but I wonder if you could answer a question for me. I created the User Friendly sample (and named the object "userFriendly") and the display method (named "show"), and everything worked as expected. But if I call userFriendly from another DTML method with <dtml-var expr="userFriendly">, it just returns something like <KebasData instance at 89e0458>. Is there a way to call KebasData objects from DTML methods? I would like to be able to use multiple KebasData objects on the same page.
Thanks. Russell Keppner
thanks for trying out my not soo functional product :) to get the KebasData object, just do a <dtml-var "userfriendly.view()"> i haven't yet found a better way to do this. p/s - i've uploaded another version of KebasData that'll check for object freshness(trivial check, really).
ethan mindlace fremen wrote:
Folks,
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
I feel like zope.org originally served as a place for you to try out zope and a place to learn about it.
It gradually aquired a collaboration side with the fishbowl.
Now I feel that zope.org's primary purposes are collaboration and education. The tryout feature has been largely surpassed by the free and for fee zope hosting that is availiable.
How do you feel about it? -- ethan mindlace fremen zopatista community liason
Many members use it to create a dynamic home page on Zope.org. However, if a good template was available, that might suffice. Also an alternate side bar method (using tinytable maybe?) would need to be found. This would break a great many members home pages to I am afraid. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
--On Monday, April 30, 2001 13:46:22 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
ethan mindlace fremen wrote:
Many members use it to create a dynamic home page on Zope.org. However, if a good template was available, that might suffice. Also an alternate side bar method (using tinytable maybe?) would need to be found.
yes, an alternate sidebar (frankly, navigation in general) would be provided. OTOH, home pages would be a bit less customisable, in part because many user's home pages override standard_html_header & footer and thus make the site-wide nav break.
This would break a great many members home pages to I am afraid.
If we had a standard way of showing off member's content, would that be OK? in addition, we are going to give people the chance (if they are doing mini-sites) to move their sites to some place more appropriate, like a zope hosting provider. -- ethan mindlace fremen zopatista community liason
ethan mindlace fremen wrote:
--On Monday, April 30, 2001 13:46:22 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
ethan mindlace fremen wrote:
Many members use it to create a dynamic home page on Zope.org. However, if a good template was available, that might suffice. Also an alternate side bar method (using tinytable maybe?) would need to be found.
yes, an alternate sidebar (frankly, navigation in general) would be provided. OTOH, home pages would be a bit less customisable, in part because many user's home pages override standard_html_header & footer and thus make the site-wide nav break.
This is good. I think Members breaking the nav is a Bad Thing(tm) anyhow. Obviously this is something you aim to prevent.
This would break a great many members home pages to I am afraid.
If we had a standard way of showing off member's content, would that be OK?
All I am after is a way to present the standard stuff, howtos, tips and products. I suspect this is all that anyone really needs. If you want more, you should just have your own site as you suggest. What objects would members still be able to create? -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
--On Monday, April 30, 2001 14:25:40 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
All I am after is a way to present the standard stuff, howtos, tips and products. I suspect this is all that anyone really needs. If you want more, you should just have your own site as you suggest.
What objects would members still be able to create?
News Items, Software Products*, Wikis, How-To's and Tips (may be merged), Folders, Links, generic HTML/Structured Text Documents. Also, more significant aspects of the site will be delegated, so community members of good standing that show an interest will probably have greater levels of permission than they do today, i.e. being able to create python scripts, etc. for the purposes of making zope.org better. *Software Products are likely to be fairly different, but they will allow the creation of Trackers and fishbowl-esque content. -- ethan mindlace fremen zopatista community liason
On Monday 30 April 2001 14:43, ethan mindlace fremen wrote:
--On Monday, April 30, 2001 14:25:40 -0600 Casey Duncan <cduncan@kaivo.com>
What objects would members still be able to create?
News Items, Software Products*, Wikis, How-To's and Tips (may be merged), Folders, Links, generic HTML/Structured Text Documents.
*Software Products are likely to be fairly different, but they will allow the creation of Trackers and fishbowl-esque content.
looks good like a good list, one more addition that would be nice is allowing Files. kapil
--On Monday, April 30, 2001 15:07:47 -0700 ender <kthangavelu@earthlink.net> wrote:
looks good like a good list, one more addition that would be nice is allowing Files.
er, right. Forgot that one. -- -mindlace- zopatista community liason
News Items, Software Products*, Wikis, How-To's and Tips (may be merged), Folders, Links, generic HTML/Structured Text Documents.
*Software Products are likely to be fairly different, but they will allow the creation of Trackers and fishbowl-esque content.
looks good like a good list, one more addition that would be nice is allowing Files.
Images? -- Andy McKay
--On Monday, April 30, 2001 23:01:06 -0700 Andy <andy@agmweb.ca> wrote:
Images?
yes. Those too. if it's currently availiable as CMF content, it will be availiable at zope.org, plus some extras. ~ethan -- -mindlace- zopatista community liason
I think Zope.org is a big how-to on itself, and by letting its users to write dtml it helps to that purpose, although just at a didactic level. I don't think many people uses dtml-at-zope.org to bring out special features to their member pages, so in order to continue offering illustrational capabilities I'd suggest a special common "dtml drawing paper" area of the site. On the subject of letting commited users to manage some areas, I agree. One of my first thoughts on Zope.org was "why doesn't it have any page snapshots?", and stuff like that. Nevertheless, it's good to realize that the standardization is very important to the sense of unity of the whole Zope development. I'm thankful to every other site that spreads Zope, but if the assets it provides weren't adknowledged by Zope.org, I probably would'nt consider them. On the other hand, if every other site had the same look and feel of Zope.org, my concerns would be lower. That's to mention how important the perception is. To the DC's plan of delegating to comunity members in order to customize and/or improve certain areas of the site, I would add that it is at least of the same importance to consider what are going to be the standards for that future site. For example: Does it make sense to enable a PIM like WorldPilot?. What about multimedia? :) Cheers, Ausum ethan mindlace fremen wrote:
--On Monday, April 30, 2001 14:25:40 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
All I am after is a way to present the standard stuff, howtos, tips and products. I suspect this is all that anyone really needs. If you want more, you should just have your own site as you suggest.
What objects would members still be able to create?
News Items, Software Products*, Wikis, How-To's and Tips (may be merged), Folders, Links, generic HTML/Structured Text Documents.
Also, more significant aspects of the site will be delegated, so community members of good standing that show an interest will probably have greater levels of permission than they do today, i.e. being able to create python scripts, etc. for the purposes of making zope.org better.
*Software Products are likely to be fairly different, but they will allow the creation of Trackers and fishbowl-esque content.
-- ethan mindlace fremen zopatista community liason
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of ethan mindlace fremen
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
Well I kind of like that my products, how-to's etc. are on Zope.org in my member area, and that I can write my own pages presenting them. It would be a bad idea to remove the possibility to write those pages in dtml. On the other hand I don't give a hoot about using the site for anything else, as I have several sites and computers for that. But I guess that I could just write html or structured text on zope.org, but than I have a sneaking suspiscion that I will need dtml at some time anyway. I mean if html was enough dtml would never have been created to begin with. Regards Max M Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
--On Monday, April 30, 2001 21:56:47 +0200 Max M <maxmcorp@worldonline.dk> wrote:
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of ethan mindlace fremen
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
Well I kind of like that my products, how-to's etc. are on Zope.org in my member area, and that I can write my own pages presenting them. It would be a bad idea to remove the possibility to write those pages in dtml.
The issue is that right now anybody is a yahoo account away from being able to write arbitrary DTML on zope.org, and that this has brought zope.org to it's knees in the past. What if there was a standard page for presenting your contributions, that your contributions could have html in them, and if you were interested in providing different ways to view member folders, you could get permission and create a skin that then anyone could select? Esp. if that skin could cover more than just member folders, but the entire site? -- ethan mindlace fremen zopatista community liason
Hi ethan, could you at least include something like my vary-tag so we can provide multi-language documents easyly? If so I can live without dtml on zope.org :-) Regards Tino Wildenhain --On Montag, 30. April 2001 17:58 -0400 ethan mindlace fremen <mindlace@digicool.com> wrote:
--On Monday, April 30, 2001 21:56:47 +0200 Max M <maxmcorp@worldonline.dk> wrote:
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of ethan mindlace fremen
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
Well I kind of like that my products, how-to's etc. are on Zope.org in my member area, and that I can write my own pages presenting them. It would be a bad idea to remove the possibility to write those pages in dtml.
The issue is that right now anybody is a yahoo account away from being able to write arbitrary DTML on zope.org, and that this has brought zope.org to it's knees in the past.
What if there was a standard page for presenting your contributions, that your contributions could have html in them, and if you were interested in providing different ways to view member folders, you could get permission and create a skin that then anyone could select?
Esp. if that skin could cover more than just member folders, but the entire site?
-- ethan mindlace fremen zopatista community liason
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Mon, Apr 30, 2001 at 05:58:36PM -0400, ethan mindlace fremen wrote: [...]
What if there was a standard page for presenting your contributions, that your contributions could have html in them, and if you were interested in providing different ways to view member folders, you could get permission and create a skin that then anyone could select?
Esp. if that skin could cover more than just member folders, but the entire site?
ooohhh, i like the skins idea. right now to read the zope site i have to turn off css in my netscrape (4.7) browser since the text ends up rendered too small for my poor old eyes... actually tho, i've recently begun using the text browser "Links" which renders tables/frames beautifully and has configurable associations so i can view images when necessary. now if only i could log in to the manage screens with it... <g> i bring this up only as a reminder that some of us still prefer old fashioned _text_ browsing. it would be a shame if in the quest for better gui, text browsing were to be overlooked. -- charlie blanchard http://baldguru.com/ LosAngeles area Zope Users Group http://lazug.org
The issue is that right now anybody is a yahoo account away from being able to write arbitrary DTML on zope.org, and that this has brought zope.org to it's knees in the past.
What if there was a standard page for presenting your contributions, that your contributions could have html in them, and if you were interested in providing different ways to view member folders, you could get permission and create a skin that then anyone could select?
Esp. if that skin could cover more than just member folders, but the entire site?
I think for the "normal" user it is perfectly fine to limit him to what the CMF framework can offer. However, there might be "power users" who contribute functionality to zope.org on their member sites. These people would probably need special treatment (and they would NOT be a real danger to zope.org like the anonymous yahoo account user). Maybe we need more roles on zope.org (e.g. "managing editor" permissions for a certain section like a project homepage or so). There has been a lot of discussion in EuroZope land on how zope.org could become more like sourceforge (i.e. offer more functionality for developers, better search for products etc.). I think what zope.org really needs before you start the redesign is a proper analysis of all the target groups and a concept for each. Zope offers so many ways to present different content views and functionalities (i.e. portals) to let's say a journalist than to a hardcore Python developer. The aim for zope.org should be making it one of the best Zope sites and one of the best dynamic sites in the web ... Joachim
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
Not at all important
Now I feel that zope.org's primary purposes are collaboration and education.
Yup
The tryout feature has been largely surpassed by the free and for fee zope hosting that is availiable.
Yup -- Andy McKay. ----- Original Message ----- From: "ethan mindlace fremen" <mindlace@digicool.com> To: <zope@zope.org> Sent: Monday, April 30, 2001 12:09 PM Subject: [Zope] writing dtml on zope.org
Folks,
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
I feel like zope.org originally served as a place for you to try out zope and a place to learn about it.
It gradually aquired a collaboration side with the fishbowl.
Now I feel that zope.org's primary purposes are collaboration and education. The tryout feature has been largely surpassed by the free and for fee zope hosting that is availiable.
How do you feel about it? -- ethan mindlace fremen zopatista community liason
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
I just checked my own member pages and was surprised to find that the only DTML is in - local_nav <!--#return "[__stuff__]"--> - index_html <!--#var standard_html_header--> <H2><!--#var document_title--></H2> ... both uses that could easily be implemented another way. -- Loren
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of ethan mindlace fremen Sent: Monday, April 30, 2001 12:09 To: zope@zope.org Subject: [Zope] writing dtml on zope.org
Folks,
I'm trying to get a feel for how important it is for you to be able to write DTML on zope.org.
I feel like zope.org originally served as a place for you to try out zope and a place to learn about it.
It gradually aquired a collaboration side with the fishbowl.
Now I feel that zope.org's primary purposes are collaboration and education. The tryout feature has been largely surpassed by the free and for fee zope hosting that is availiable.
How do you feel about it? -- ethan mindlace fremen zopatista community liason
It gradually aquired a collaboration side with the fishbowl.
Now I feel that zope.org's primary purposes are collaboration and education. The tryout feature has been largely surpassed by the free and for fee zope hosting that is availiable.
Let me add some side comment about the zope site. Imho, the way content is "sorted" on the zope.org site is not "perfect". What does a newbie when he search for information? He goes to the doc area, the howto area, etc... Noone (including zope experts) will think : "haha, I need information about this, and I know Philippe Jadin have this information, I'll go to his member page". My conclusions? Zope.org should not be author-oriented, but content-oriented. This would make it lot easier to find information. I hope we (members) could be humble enough to add content to "purpose" pages, instead of our own page. I don't see zope.org as an hosting for member pages (I have my personnal site for this), but as a site with a complete, member-contributed documentation. All members efforts should not be put in *their* own personal homepage, but on the commonly available documentation. This does'nt prevent putting our name on each of our contributions of course;-) In this perspective, I see no use for dtml in pages beside as a learning tool. My $0.02 Philippe Jadin
participants (21)
-
Andy -
Andy McKay -
Ausum -
bak -
Bobby Mathew -
Casey Duncan -
Charlie Blanchard -
Danny William Adair -
ender -
ethan mindlace fremen -
Joachim Werner -
Loren Stafford -
Marc Fischer -
Max M -
Paula Mangas -
Phil Harris -
Philippe Jadin -
Russell Keppner -
Steve Drees -
Thomas B. Passin -
Tino Wildenhain