+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: How to go about creating a "command line" webpage?

  1. #1
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    How to go about creating a "command line" webpage?

    I want to create a simple page consisting of essentially a text box. It would use PHP, or javascript, or another language, to compute the input and do something. For example, google apples would, well, google apples. Tweet Hello, would, tweet hello, cheezburger would open a predefined set of cheezburger network sites, url apple.com would open the apple website, and so on, and so forth.

    For now I want to keep it personnal, offline. My main question is wether I should be using JavaScript (or other client-side), or PHP (or other serverside). I can think of one way to do this in PHP, which would be to run the string through a list of commands and check for a matching one, but I would like to add real-time some features like auto-complete or syntax help. Is there a way for javascript to cycle through files? Is there another client-side script that could do that? Can I do most of these on a PC, without uploading it, only running something like wampserver to run PHP, or not even that if it is JS?

    Thanks in advance!

    P.S. How do you get the cursor to go directly to the text box like the google home page?

    Also, I plan on potentially releasing this later. What would be the most efficient scripting language for running it, considering each user would have their own specific settings for something like "search Apples" or wether they want to open in a new apge or not or anything of the sort?

    --------------------
    Edit:
    What language would I use to run something like this in Windows' native command line environment? (Command Prompt)
    Last edited by shant93; 01-12-2011 at 02:22 PM.

  2. #2
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: How to go about creating a "command line" webpage?

    Use Ruby on Rails.

    Try the interactive prompt at http://tryruby.org/

    It's really neat.

    It might take a bit to learn, but it's probably your best bet for something like this. JavaScript/PHP would be heavy on the server.

    As to your question about the cursor: It's a attribute called autofocus in HTML5. <input type="text" autofocus="true" /> (for example)
    Last edited by leafypiggy; 01-12-2011 at 02:32 PM.
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  3. #3
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: How to go about creating a "command line" webpage?

    That should be .org, by the way

    I think I'll get to learning Ruby. I've heard of it but never really used it. Is i implementable in a local environment?

  4. #4
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: How to go about creating a "command line" webpage?

    If by "local environment" you mean a VPS or home server: yes. It works on Windows, *nix, and OSX
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  5. #5
    vv.bbcc19's Avatar
    vv.bbcc19 is offline Community Advocate vv.bbcc19 is just really nice
    Join Date
    Jun 2010
    Location
    India
    Posts
    1,505

    Re: How to go about creating a "command line" webpage?

    Quote Originally Posted by leafypiggy View Post
    Use Ruby on Rails.

    Try the interactive prompt at http://tryruby.org/

    It's really neat.

    It might take a bit to learn, but it's probably your best bet for something like this. JavaScript/PHP would be heavy on the server.

    As to your question about the cursor: It's a attribute called autofocus in HTML5. <input type="text" autofocus="true" /> (for example)
    PHP is not heavy on the server.Infact its faster too.
    Ruby on the Rails is the best ofcourse.
    Javascript is a bit heavy but if you are with it for long..dont mind the weight on server.Just go about it.
    BCV | Community Support Representative
    █ x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  6. #6
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: How to go about creating a "command line" webpage?

    Is ruby Serrver-Side code? If it is, I still want to know if JavaScript can go through a file, and if it can't, if there is a client-side code which can.

  7. #7
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: How to go about creating a "command line" webpage?

    Javascript is a bit heavy but if you are with it for long..dont mind the weight on server.Just go about it.
    Javascript is the lightest of them all if you're looking at them from a server standpoint, as it runs within the client rather than on the server.

    Personally I would implement the main query decoding of this project in Javascript, as it is considerably more immediate than having to go back to the server every time for a response. However, for cases where using Javascript might not work as well, such as sending a tweet, I would then fall back to a PHP script that the JS then sends a tweet request to.

    Edit:
    Precisely what do you mean by 'JavaScript can go through a file'?
    Last edited by lemon-tree; 01-15-2011 at 09:24 AM.

  8. #8
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: How to go about creating a "command line" webpage?

    Quote Originally Posted by lemon-tree View Post
    Precisely what do you mean by 'JavaScript can go through a file'?
    I mean, when I hit enter, can JavaScript Isolate whatever comes before the first " " (space) character and search through a file for the corresponding command, supplying the arguments?

  9. #9
    denzil is offline x10 Sophmore denzil is an unknown quantity at this point
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    134

    Re: How to go about creating a "command line" webpage?

    You can't use JavaScript to access server-side files. You will need some server-side script for this. I don't think PHP will be too heavy for what you want to achieve.

    edit:
    I'm assuming that you want to add new commands in some sort of a database on the server, which will require server-side access I believe.
    Last edited by denzil; 01-15-2011 at 10:00 AM.

  10. #10
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: How to go about creating a "command line" webpage?

    But I still wanted to integrate some syntax-help, so, real-time server requests (which I believe are banned), but I guess it's not extremely important, specially since I don't really have time to learn a new language for a few months and even JavaScript is practically new to me.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 06-26-2010, 05:44 PM
  2. Replies: 1
    Last Post: 05-08-2010, 03:17 AM
  3. "Error fetching zone data" when creating MX entries
    By d61helix in forum Free Hosting
    Replies: 6
    Last Post: 05-25-2009, 02:18 PM
  4. Replies: 1
    Last Post: 10-15-2007, 06:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers