how do i get text from a web page?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

how do i get text from a web page?

Post by Steve Denney » Sat Feb 15, 2014 7:26 am

Hi, I've made a php page that lists the contents of a dir on our server.
I'd like to get the text (list of files) that appears if you open that page in a browser.
I don't want to open the page with the user's browser. I just need the directory contents.
Get url works with text files but not this.
I could make php write the list to a text file and get that with livecode but I'm hoping there's an easier way.

Any help much appreciated

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

Re: how do i get text from a web page?

Post by Klaus » Sat Feb 15, 2014 12:57 pm

Hi Steve,

well, that's a one liner:
...
put url "http://www.your_server.com/name_of_web_page.php" into fld "listing"
...
:D


Best

Klaus

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: how do i get text from a web page?

Post by Steve Denney » Sun Feb 16, 2014 1:45 am

Yeah but Klaus it didn't work :(
The put/get variable is empty but the page in the browser shows the files.
I'll try again later on today...
Thanks

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: how do i get text from a web page?

Post by Simon » Sun Feb 16, 2014 2:13 am

Hi Steve,
make sure you include the "http://..."
If you can view the results via a browser then this should work for you.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: how do i get text from a web page?

Post by Steve Denney » Sun Feb 16, 2014 6:36 am

Thanks again Klaus. And Simon. You're right. It's working.
Ok here's my perfect hindsight theory... sat evening (heavy usage period) my satellite internet times out (or I don't give it enough time before I lose patience).
Cheers!
Steve

Post Reply