Cold Fusion Example.
Hi All, sorry if anyone saw the coldfusion post a moment ago there was an error on my part.
So, I thought I would give a little back. Here is a cold fusion example to work with Lesson 2 like the PHP and ASP example..
first make sure you have the screen-scraper server running and coldfusion has the screen-scraper.jar in path. You can read more about that in the Document section of the site.
Bleow is the cfobject tag based version of calling a screen-scraper session.
type = "java"
class = "com.screenscraper.scraper.RemoteScrapingSession"
name = "RemoteScrapingSession">
textReturned: #test#
and for those of you who work in cfscript, as I am want to do, here is a script call to the object.
RemoteScrapingSession = CreateObject("java","com.screenscraper.scraper.RemoteScrapingSession");
remoteSession = RemoteScrapingSession.init("Hello World","localhost",8778);
remoteSession.setVariable( "TEXT_TO_SUBMIT", urlEncodedFormat("Good-bye world!") );
remoteSession.scrape();
xlnt = remoteSession.getVariable( "FORM_SUBMITTED_TEXT" );
remoteSession.disconnect();
test:#xlnt#
if there is a need for a more detailed example I would be happy to submit some code. I am working on a private project but I am sure I could alter it in a way that would be non-proprietary.
Thanks, Fred
Cold Fusion Example.
Fixed! Thanks for pointing that one out.
Todd
Cold Fusion Example.
oops...
you need to remove this code...
<cfdump var="#dataStructure#">
around line 78 or so.. it was a test to see the structure..
Thanks, Fred
Cold Fusion Example.
Wow. Thanks again, Fred, for sharing your expertise. I've just posted your code to our fourth tutorial here: http://www.screen-scraper.com/support/tutorials/tutorial4/invoking_screen-scraper_from_cold_fusion.php. Just let me know if any corrections need to be made.
Regarding the two issues you raised--the error-checking method in PHP actually isn't necessary in the Java/Cold Fusion driver, as it will simply throw an exception instead (which you alluded to in your comments). Also, the buffer size isn't an issue either in the Java driver, as it's able to handle all of that internally.
Kind regards,
Todd
Cold Fusion Example.
Hi Todd, that code looks good.
Tutorial 4
!doctype>
here is the Lesson 4 coldfusion code using tags.. if you think people would like to see the script verion I can work that up as well. I am not a big fan of mixing cfscript and output, so for something like this that needs to show a table I usually stick with tags. But it really woudl be no trouble to convert to script. I basically lifted the layout from php and retained the comments. And I ran into trouble with the setBufferSize and isError. I will have look at that later.
type = "java"
class = "com.screenscraper.scraper.RemoteScrapingSession"
name = "RemoteScrapingSession">
ok.. well have a nice day, and if I don't hear from you today have a nice weekend.
Thanks, Fred
Cold Fusion Example.
Hi Fred,
Thanks again for sharing your expertise. I've just integrated your code into our second tutorial here: interacting with cold fusion. What would you think about taking a look to see if you can think of any corrections that should be made? Any feedback would be appreciated.
Kind regards,
Todd
Cold Fusion Example.
of course you can use the code. I am working on the data stuff today, and like I said.. I will clean it up for you and you can do with it what you like...
You have a great product and great team of people helping out.
Thanks, Fred
Cold Fusion Example.
Fabulous! This is great, Fred. I have to admit, none of us here in our shop have a lot of expertise in ColdFusion. Is there a chance you'd be willing to let us include some of your work in our tutorials and/or documentation? Also, have you, by chance, implemented anything that requires iterating over DataSets, as in our fourth tutorial (http://community.screen-scraper.com/Tutorial_4_Page_1)? If so, would you mind if we included your example in that tutorial? If you'd like, please feel free to email me directly about this. My email address is my first name at screen-scraper.com.
Kind regards,
Todd Wilson