Re: [WebDNA] how can i grab the contents of a post?

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106731
interpreted = N
texte = This is a multi-part message in MIME format. --------------080201090601000300070705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Windows server 2003 / iis 6 On 6/13/11 12:09 PM, Olin Lagon wrote: > Am running 6 on Linux. What platform are you using to get what you > have? That would make it possible to piece back the XML. > > Am using an API from The Energy Detective (not published on their > site) which is a real time energy monitor. > > Aaron Michael Kaczmarek wrote: >> Could this potentially be a matter of webDNA version? >> >> I'm running 6 and am able to receive xml callbacks to a dna page just >> fine; getting xml contents with formvariables. >> >> With formvariables, I get a single variable that is broken at the >> first "=", so formvars returns this: >> [name] = > [value] = "1.0" encoding="UTF-8"?>......and so on with the rest of xml >> >> >> what API are you working with by the way? >> >> >> >> >> >> On 6/13/11 11:32 AM, Olin Lagon wrote: >>> I had already written and tested the XML logic in webdna so to save >>> time I just wrote the following lines of PHP that grabbed the post >>> contents, assigned it to a form variable, and redirected it to a >>> webdna script for processing. The parse.tpl returns XML and this PHP >>> script sends it back to the requestor with the correct HTTP header. >>> >>> >> if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){ >>> $postText = file_get_contents('php://input'); >>> } >>> $content = >>> file_get_contents("http://www.kanuhawaii.org/ted/parse.tpl?thisxml=" >>> .urlencode($postText)); >>> >>> header("Content-type: text/xml"); >>> echo $content; >>> ?> >>> >>> This could probably be collapsed to two lines but what I have above >>> works and it is good enough :) >>> >>> >> header("Content-type: text/xml"); >>> echo file_get_contents("http://yourserver/parse.tpl?thisxml=" >>> .urlencode(file_get_contents('php://input'))); >>> >>> ?> >>> >>> >>> Psi Prime Inc, Matthew A Perosi wrote: >>>> Since I'm completely ignorant when it comes to PHP, what is the >>>> code you used? >>>> Did you grab the incoming content, save it as a file then had >>>> WebDNA trigger occasionally for the written file? >>>> >>>> Matt >>>> >>> --------------------------------------------------------- This >>> message is sent to you because you are subscribed to the mailing >>> list . To unsubscribe, E-mail to: archives: >>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >>> support@webdna.us >> >> --------------------------------------------------------- This >> message is sent to you because you are subscribed to the mailing list >> . To unsubscribe, E-mail to: archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us > --------------------------------------------------------- This message > is sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us --------------080201090601000300070705 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Windows server 2003 / iis 6


On 6/13/11 12:09 PM, Olin Lagon wrote:
Am running 6 on Linux. What platform are you using to get what you have? That would make it possible to piece back the XML.

Am using an API from The Energy Detective (not published on their site) which is a real time energy monitor.

Aaron Michael Kaczmarek wrote:
Could this potentially be a matter of webDNA version? 

I'm running 6 and am able to receive xml callbacks to a dna page just fine; getting xml contents with formvariables. 

With formvariables, I get a single variable that is broken at the first "=", so formvars returns this:
[name] = <?xml version
[value] = "1.0" encoding="UTF-8"?>......and so on with the rest of xml


what API are you working with by the way?





On 6/13/11 11:32 AM, Olin Lagon wrote:
I had already written and tested the XML logic in webdna so to save time I just wrote the following lines of PHP that grabbed the post contents, assigned it to a form variable, and redirected it to a webdna script for processing. The parse.tpl returns XML and this PHP script sends it back to the requestor with the correct HTTP header.

<?php
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){
    $postText = file_get_contents('php://input');
}
$content = file_get_contents("http://www.kanuhawaii.org/ted/parse.tpl?thisxml=".urlencode($postText));
header("Content-type: text/xml");
echo $content;
?>

This could probably be collapsed to two lines but what I have above works and it is good enough :)

<?php
header("Content-type: text/xml");
echo file_get_contents("http://yourserver/parse.tpl?thisxml=".urlencode(file_get_contents('php://input')));
?>
 


Psi Prime Inc, Matthew A Perosi wrote:
Since I'm completely ignorant when it comes to PHP, what is the code you used? 
Did you grab the incoming content, save it as a file then had WebDNA trigger occasionally for the written file?

Matt

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--------------080201090601000300070705-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] how can i grab the contents of a post? ("Brian B. Burton" 2011)
  2. Re: [WebDNA] how can i grab the contents of a post? (Aaron Michael Kaczmarek 2011)
  3. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  4. Re: [WebDNA] how can i grab the contents of a post? (Aaron Michael Kaczmarek 2011)
  5. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  6. Re: [WebDNA] how can i grab the contents of a post? ("Psi Prime Inc, Matthew A Perosi " 2011)
  7. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  8. Re: [WebDNA] how can i grab the contents of a post? ("Psi Prime Inc, Matthew A Perosi " 2011)
  9. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  10. Re: [WebDNA] how can i grab the contents of a post? (Stuart Tremain 2011)
  11. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  12. Re: [WebDNA] how can i grab the contents of a post? (Stuart Tremain 2011)
  13. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  14. Re: [WebDNA] how can i grab the contents of a post? (Stuart Tremain 2011)
  15. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  16. Re: [WebDNA] how can i grab the contents of a post? (Stuart Tremain 2011)
  17. [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
This is a multi-part message in MIME format. --------------080201090601000300070705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Windows server 2003 / iis 6 On 6/13/11 12:09 PM, Olin Lagon wrote: > Am running 6 on Linux. What platform are you using to get what you > have? That would make it possible to piece back the XML. > > Am using an API from The Energy Detective (not published on their > site) which is a real time energy monitor. > > Aaron Michael Kaczmarek wrote: >> Could this potentially be a matter of webDNA version? >> >> I'm running 6 and am able to receive xml callbacks to a dna page just >> fine; getting xml contents with formvariables. >> >> With formvariables, I get a single variable that is broken at the >> first "=", so formvars returns this: >> [name] = > [value] = "1.0" encoding="UTF-8"?>......and so on with the rest of xml >> >> >> what API are you working with by the way? >> >> >> >> >> >> On 6/13/11 11:32 AM, Olin Lagon wrote: >>> I had already written and tested the XML logic in webdna so to save >>> time I just wrote the following lines of PHP that grabbed the post >>> contents, assigned it to a form variable, and redirected it to a >>> webdna script for processing. The parse.tpl returns XML and this PHP >>> script sends it back to the requestor with the correct HTTP header. >>> >>> >> if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){ >>> $postText = file_get_contents('php://input'); >>> } >>> $content = >>> file_get_contents("http://www.kanuhawaii.org/ted/parse.tpl?thisxml=" >>> .urlencode($postText)); >>> >>> header("Content-type: text/xml"); >>> echo $content; >>> ?> >>> >>> This could probably be collapsed to two lines but what I have above >>> works and it is good enough :) >>> >>> >> header("Content-type: text/xml"); >>> echo file_get_contents("http://yourserver/parse.tpl?thisxml=" >>> .urlencode(file_get_contents('php://input'))); >>> >>> ?> >>> >>> >>> Psi Prime Inc, Matthew A Perosi wrote: >>>> Since I'm completely ignorant when it comes to PHP, what is the >>>> code you used? >>>> Did you grab the incoming content, save it as a file then had >>>> WebDNA trigger occasionally for the written file? >>>> >>>> Matt >>>> >>> --------------------------------------------------------- This >>> message is sent to you because you are subscribed to the mailing >>> list . To unsubscribe, E-mail to: archives: >>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >>> support@webdna.us >> >> --------------------------------------------------------- This >> message is sent to you because you are subscribed to the mailing list >> . To unsubscribe, E-mail to: archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us > --------------------------------------------------------- This message > is sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us --------------080201090601000300070705 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Windows server 2003 / iis 6


On 6/13/11 12:09 PM, Olin Lagon wrote:
Am running 6 on Linux. What platform are you using to get what you have? That would make it possible to piece back the XML.

Am using an API from The Energy Detective (not published on their site) which is a real time energy monitor.

Aaron Michael Kaczmarek wrote:
Could this potentially be a matter of webDNA version? 

I'm running 6 and am able to receive xml callbacks to a dna page just fine; getting xml contents with formvariables. 

With formvariables, I get a single variable that is broken at the first "=", so formvars returns this:
[name] = <?xml version
[value] = "1.0" encoding="UTF-8"?>......and so on with the rest of xml


what API are you working with by the way?





On 6/13/11 11:32 AM, Olin Lagon wrote:
I had already written and tested the XML logic in webdna so to save time I just wrote the following lines of PHP that grabbed the post contents, assigned it to a form variable, and redirected it to a webdna script for processing. The parse.tpl returns XML and this PHP script sends it back to the requestor with the correct HTTP header.

<?php
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){
    $postText = file_get_contents('php://input');
}
$content = file_get_contents("http://www.kanuhawaii.org/ted/parse.tpl?thisxml=".urlencode($postText));
header("Content-type: text/xml");
echo $content;
?>

This could probably be collapsed to two lines but what I have above works and it is good enough :)

<?php
header("Content-type: text/xml");
echo file_get_contents("http://yourserver/parse.tpl?thisxml=".urlencode(file_get_contents('php://input')));
?>
 


Psi Prime Inc, Matthew A Perosi wrote:
Since I'm completely ignorant when it comes to PHP, what is the code you used? 
Did you grab the incoming content, save it as a file then had WebDNA trigger occasionally for the written file?

Matt

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--------------080201090601000300070705-- Aaron Michael Kaczmarek

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

template includes encrypted template (1999) RE: Problems with dbcatalog.exe (1997) Re:Multiple appends with checkboxes (1998) expansion domain freak out (2003) [WebDNA] Test (2008) Where is the secure setting for text variables? (2003) RE: date (1998) Error Lob.db records error message not name (1997) shipcost - cleaner with a table (1998) encryption seeds xing (1998) Java and WebDNA (2002) RE: Displaying Location (1997) RE: OK, here goes... (1997) More on the email templates (1997) WebDNA Verison 4.5 will Not Restart! This SUCKS! (2002) Use of Back and Reload Buttons on ShoppingCart page? (1997) Hard Questions ? (1997) requiring form fields? (2000) Problems with date math (1997) WebCat2 as a chat server? (1997)