implement a new browser

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

implement a new browser

Post by tal_is_back » Wed Feb 29, 2012 11:37 am

Hi,

I would like to know if implemeting a new browser with livecode was possible, and if it was difficult to do? ( how many line codes?)

I want a new browser, cause i use a website, which edits travel tickets, ( the tickets are edited in .asp extension)

I want, that every time a ticket is edited, to extract the datas i need to an external file( or in rev).

Ticket number / Name customer / Price passenger / tax passenger / Price car / tax car / total price

If it is too difficult, how much could it cost approximatively to make it do by someone? thanks

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: implement a new browser

Post by Klaus » Wed Feb 29, 2012 11:57 am

Hi Tal,

LiveCode comes with a nice Browser example stack!
Menu: Help: Example stacks and Resources -> Folder "Examples": Browser Sampler.rev


Best

Klaus

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: implement a new browser

Post by tal_is_back » Wed Feb 29, 2012 2:35 pm

Ok thanks, you think it is easy to customize it like i said in my previous post : adding new internet browser functionnalities

Tal

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: implement a new browser

Post by Klaus » Wed Feb 29, 2012 2:48 pm

Hi Tal,

yes, this is possible.
If this is easy or not, I cannot say 8)

Please check the example stack and get used to the commands and functions that "control"
a browser object in LiveCode. then you can decide if your modification are easy or not :)


Best

Klaus

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: implement a new browser

Post by tal_is_back » Wed Feb 29, 2012 8:10 pm

Hi,

I looked at the example browser, it is good one, i am checking how to do what i want, so first i am trying to extract data from a simple pdf file :
put revBrowserOpen(the windowId of this stack, "http://www.senat.fr/rap/r08-441/r08-4411.pdf") into tBrowserId
I get the browserid and then i try to save or extract data from it using jscripts :
get revBrowserExecuteScript(sBrowserId, ";")
or
get revBrowserCallScript(tBrowserId, ";")

But i didnt succeed, if someone can do that?

Tal

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: implement a new browser

Post by tal_is_back » Wed Feb 29, 2012 8:26 pm

i also tried this :

libURLDownloadToFile "http://www.senat.fr/rap/r08-441/r08-441 ... C:\Program Files (x86)\RunRev\LiveCode 5.0.2\sav","downloadComplete"


No error, but the folder is empty...

Tal

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: implement a new browser

Post by Klaus » Wed Feb 29, 2012 8:29 pm

Hi Tal,
tal_is_back wrote:...
get revBrowserExecuteScript(sBrowserId, ";")
or
get revBrowserCallScript(tBrowserId, ";")
...
I don't know much about JavaScript, but I guess that a simple semicolon ;
is neither a valid JavaScript nor the name of a JavaScript function! 8)

Check the dictionary for "revBrowserExecuteScript" and "revBrowserCallScript".


Best

Klaus

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: implement a new browser

Post by Klaus » Wed Feb 29, 2012 8:34 pm

Hi Tal,
tal_is_back wrote:i also tried this :
libURLDownloadToFile "http://www.senat.fr/rap/r08-441/r08-441 ... C:\Program Files (x86)\RunRev\LiveCode 5.0.2\sav","downloadComplete"
No error, but the folder is empty...
Tal
1. Alway use the SLASH / as a pathdelimiter in LiveCode.
The Windows BACKSLASH in pathnames is only necessary when you do a SHELL call on Windows.

2.C:\Program Files (x86)\RunRev\LiveCode 5.0.2\sav
is this ("sav") the FOLDER where you want to download the PDF to?
If yes, you need to specify a FILENAME here, not a target folder:
THis should work:
...
## watch linebreak!
libURLDownloadToFile "http://www.senat.fr/rap/r08-441/r08-441 ... C:/Program Files (x86)/RunRev/LiveCode 5.0.2/sav/New PDF File from Net.PDF","downloadComplete"
...

Best

Klaus

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: implement a new browser

Post by tal_is_back » Wed Feb 29, 2012 8:50 pm

Thanks, i succeeded doing like that :

set the defaultfolder to "C:\save "

libURLDownloadToFile "http://www.senat.fr/rap/r08-441/r08-4411.pdf",test

So the file test is saved in my t folder

it can be a solution, i have to automate it for each specific filei wanna save.

The second step is to find a way in rev to directly extract data from pdf file...

Tal

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: implement a new browser

Post by Klaus » Wed Feb 29, 2012 10:04 pm

Hi Tal,
tal_is_back wrote: set the defaultfolder to "C:\save "
libURLDownloadToFile "http://www.senat.fr/rap/r08-441/r08-4411.pdf",test
Important hint! Use QUOTES around the filename:
libURLDownloadToFile "http://www.senat.fr/rap/r08-441/r08-4411.pdf","test"
And always use a SLASH / in LiveCode as the path delimiter, in case I did not mention this yet! 8)

OK, setting the defaultfolder will do, but directly setting the filename without changing the defaultfolder is more elegant :D
tal_is_back wrote:it can be a solution, i have to automate it for each specific filei wanna save.
Ther are several ways to automatically save the files like setting the name to something with "the seconds",
so you could extract the exact date and time of the download if necessary.

Think about what you need and ask again here :)
tal_is_back wrote:The second step is to find a way in rev to directly extract data from pdf file...
Uhh! That's not an easy task and I wish you good luck!
Please post here if you found a solution! :D


Best

Klaus

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: implement a new browser

Post by mwieder » Wed Feb 29, 2012 10:41 pm

The second step is to find a way in rev to directly extract data from pdf file...
You may just want to shell to a freeware commandline application to do that

http://www.foolabs.com/xpdf/home.html

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: implement a new browser

Post by tal_is_back » Wed Feb 29, 2012 10:59 pm

Ther are several ways to automatically save the files like setting the name to something with "the seconds",
so you could extract the exact date and time of the download if necessary.

Think about what you need and ask again here
Thats the automation i wanna do : It is a website, which edit travel ticket in .asp to be printed, i want that everytime a ticket is edited ---> save the file or extract the datas


Finaly, thats what i need, a table containing that datas : Ticket number / Name customer / Price passenger / tax passenger / Price car / tax car / total price

You may just want to shell to a freeware commandline application to do that

http://www.foolabs.com/xpdf/home.html
YEs, maybe there is a way to call that software from revolution?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: implement a new browser

Post by mwieder » Wed Feb 29, 2012 11:05 pm

See the shell function in the documentation.

Post Reply