Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 6:57 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Opus Post Web Data Actions
PostPosted: August 5th, 2005, 12:33 am 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
Hi,

The Post Web Data Actions (Source) box, it is very difficult to rename the String. At least I find it difficult, I need to double click it about 20 times to change the name.

Is anyone else having the same problem?


Also is it possible to post web data via Opus Script? If not can this feature be added to furture releases of Opus.


Joe


For this message josephroddy has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Post Web Data
PostPosted: August 8th, 2005, 8:22 am 
Offline

Joined: January 10th, 2005, 11:08 am
Posts: 63
Location: Birmingham, United Kingdom
Opus: All between ver Pro XE 4.5 and Ver 9.62
OS: Windows XP Pro SP3
System: Intel Core2 Duo 2.67Ghz, Matrox Millennium G550 dual head graphics card
Hi Joe,

Yes I found the same problem but I found it easiest to add all the parameter strings that I needed, then working from the top set the variable and then go straight to the associated parameter and it will go into edit mode with a single click.
After this if I have to edit one I found a triple-click seems to throw it into edit mode. Hope this helps.
I too would be glad if someone could tell me how the two script actions InternetPostData() and InternetGetData() work.

Andy T.


For this message Andrew Thompson has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 8th, 2005, 10:35 am 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
I found the help information, the scripting example given is:

I assume that the URL is a set variable which points to PHP or ASP page. I must go try this out if it works it will save me a lot of time.

// To send an Object, first set up the Object:
var obj = new Object()
obj.Name = "John"
obj.Age = 21
obj.ShoeSize = 8
out = InternetPostData(url, obj, true)
// will return an object with Name, Age and ShoeSize members set.


The help on the InternetGetData() is very limited:

var newData = InternetGetData("www.example.com/cgi-bin/checkdata.pl")

Not sure how this would work, where is the pulled data stored?

Joe


For this message josephroddy has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 8th, 2005, 11:05 am 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
josephroddy wrote:
var newData = InternetGetData("www.example.com/cgi-bin/checkdata.pl")

Not sure how this would work, where is the pulled data stored?

As members of the data object returned as "newData" - so if your script returns "bob=1&fish=flounder", newData would have two members: newData.bob and newData.fish, with the values "1" and "flounder" respectively.

_________________
ddww Opus Developer


For this message Duncan Lilly has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 19th, 2006, 9:42 pm 
Offline

Joined: January 19th, 2006, 9:25 pm
Posts: 4
Location: Ashland, PA, USA
Hey everyone! I hope you're all doing well!! First time picking up Opus in ... an embarassingly long time.

I'm trying to make a pub (in Opus Pro XE v5.5) that stores the contents of a web page (http://www.x-rates.com/calculator.html) into a variable, and then parses the raw html to pick out the three-letter abbreviation for each country and the exchange rates for each.

But when I tried the Post Web Data action, the web page sent from the server states:

Quote:
405 Method Not Allowed
The requested method POST is not allowed for the URL /calculator.html.


The old version of Opus had a radio button to allow you to Post or Get using that action - but it's missing from this version. So I looked up the scripting way to do it in this discussion board. Unfortunately, the InternetGetData() function returns the same error from the server.

Any ideas how to do this? Or is it a bug that the Get function still uses the Post method?

Cheers,
John


For this message jeccker has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 20th, 2006, 11:08 am 
Offline

Joined: October 25th, 2004, 3:03 pm
Posts: 540
Location: Tyalgum Creek. Australia
Opus: Opus Pro Latest version 9.02 Build 16458
OS: Won 10
System: Asus laptop Intel Core i5 8 gig ram, big monitor, reading glasses
Welcome back John!
It has been a long time indeed
Even so, I can't help you on this one because you are too darned advanced for me still, :P but I promise to catch up one day.
Cheers
Graham

_________________
Too much coffee can result in frequent toilet breaks!


For this message Graham Baglin has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 20th, 2006, 1:29 pm 
Offline

Joined: January 19th, 2006, 9:25 pm
Posts: 4
Location: Ashland, PA, USA
I always had a problem with that, didn't I? :-)

I did find a partial work-around. Instead of posting to the final html page, I made a PHP script on my server that uses the Header() function to redirect the browser to the intended page. That way the html page doesn't think that someone is trying to post to it.

But ... I don't seem to be able to get the entire page in the destination variable. Is there a character limit for receiving web data? To demonstrate, create a Post action that targets www.eccker.org/test.php. Select a variable for the Destination of the action, and insert that variable into a text object with a scrollbar. The text returned does not go all the way down to the bottom of the html page. Luckily the info I need is toward the top of the document, but other similar uses may need to pick out data that's further down the page.

And another question that's related to the project, but not necesarilly to Post or Get: Is there an Opus Script function that will search through a string and replace a combination of characters with other characters? Like ereg_replace() in PHP. In the data that's received from the web site, there are two lists that I put into separate arrays - the list of three-letter country/currency codes, and the list of exchange rates. The data I need is part of the javascript on the page, and appears like this:

Code:
var currency = new Array("USD","AUD","BRL","GBP","CAD","CNY","DKK",
      "EUR","HKD","INR","JPY","MYR","MXN","NZD","NOK","SGD","ZAR",
      "KRW","LKR","SEK","CHF","TWD","THB","VEB");


I can strip out the meat of it by using the String.word() function and the parenthesis at the begining and end of each line as the delimiters. But I can't use the split() function with more than one delimiting character, so I need to get rid of all the quotation marks and leave just the commas. Normally I'd use some kind of "replace" function to replace each occurrance of " with a null string. But I couldn't find any replace functions like this in Opus Script. So I had to build a loop that examined each character in the string and appended it into a new variable unless the character was the " character. Not a difficult work-around, but I'd much rather use a replace function. :-) If there is no such function, can you please add it to the wish list? Also, make sure that the parameters can accept patterns (multiple characters) and not just single characters. (at the same time, it would be helpful if other functions could accept entire patterns - like the split() function mentioned above)


For this message jeccker has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 59 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group