Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is it possible to load the text of a webpage into a textarea?

    I have a html text area named, paste.

    Is there a way to automatically take the text from http://www.weather.com/weather/print/USAL0371 & load it into that text area?

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Using PHP or similar, it is absolutely possible.

    Look into CURL.

    http://www.google.com/search?hl=en&s...i=g10&aql=&oq=

  • #3
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fumigator View Post
    Using PHP or similar, it is absolutely possible.

    Look into CURL.

    http://www.google.com/search?hl=en&s...i=g10&aql=&oq=
    Thanks for your suggestion. The problem is that the computer that will be running this script is a company Mac. I wont be able to install a php compiler. So as far as I know, I'm limited to html & javascript.

    It's just a simple little script that will automatically parse out the garbage lines from the text for my dad. It will be stored & used from his work's hard drive.

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You can install PHP/Apache locally very easily, using XAMPP.

    http://www.apachefriends.org/en/xampp-macosx.html

  • #5
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fumigator View Post
    You can install PHP/Apache locally very easily, using XAMPP.

    http://www.apachefriends.org/en/xampp-macosx.html
    Thanks for the link. But the problem is I cant install anything on the work computer. So I'm stuck using whatever Firefox or Safari can handle - which as far as I know is html & javascript.

    Any ideas? Is there another broswer-ready programming language I can use along-side javascript?

  • #6
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,460
    Thanks
    11
    Thanked 600 Times in 580 Posts
    Quote Originally Posted by alienaa View Post
    Thanks for the link. But the problem is I cant install anything on the work computer. So I'm stuck using whatever Firefox or Safari can handle - which as far as I know is html & javascript.

    Any ideas? Is there another broswer-ready programming language I can use along-side javascript?
    i can't install apps at work, but i can add firefox extensions, perhaps your'e in the same boat.

    2 solutions:
    1. POW, or Plain Old Webserver: you can run xdomain requests using "server-side" javascript in it's localhost http server. you can add a script tag, and set it's .src to your localhost, passing the url to download to a simple .sjs script in the root folder that spits out json+callback.


    2. greasemonkey: provides a special methos to make xdomain calls, but can only be run once- on page load. you should be able to find an example userScript you can modify to get going.


    3. if you can't add extentions, you can use an open data source.

    using a div, not a textarea:
    Code:
    <html>
    <div id="paste">Loading Weather...</div>
    
    <script>
    function cb(o){
       document.getElementById("paste").innerHTML=o.query.results.channel.item.description;
    }
    </script>
    
    <script src="http://query.yahooapis.com/v1/public/yql?format=json&diagnostics=false&callback=cb&q=select%20*%20from%20weather.forecast%20where%20location%3D90210"></script>
    
    </html>
    Last edited by rnd me; 03-18-2010 at 09:09 AM.
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •