Get CLI Unix Tips

Started by Atomm · 8 posts · 1,294 views

  1. #2
    I just ask this guy from my bf2 clan, he is good with CLI. Actually I have gotten pretty good.
  2. #3
    Alright Bubba, I have a new quest for you....

    Using php's CURL command and regular expressions, create a script to grab content from other websites. :-)

  3. #4
    Atomm wrote:
    Alright Bubba, I have a new quest for you....

    Using php's CURL command and regular expressions, create a script to grab content from other websites. :-)



    It is called scraping. Check this out, a 101 document describing EXACTY what you want 😉


    Okay it is not that complete but it is a start, why reinvent the wheel. 😉
    Okay this is probably not even helpful but it is what i had real fast 😛
    http://www.netprofess.com/articles/screen_...ns_curl_php.pdf

    I have been playing with Unix for 13 years now. I used to write a lot of C code using gcc with a VT100 terminal. Old school baby!!! 😉
    I do admit I am a bit rusty these days with all he visual stuff but I am actually better at the CLI.

    Do you seriously need some code? I could probably find something for you.. I started messing with scraping awhile back for my home automation stuff. The home automation software lets you script things so you can actually ask the computer "did I win the lottery" and it goes and runs a script, scrapes the web, takes results and outputs them into a text file that is then Read by the TTS (text To Speech) interpreter! Rather cool actually! 😉

    I have some Perl code that does it.

    I have a LOT of computer books. I could open a book store. 🙂 My job is cool that way, I am always getting computer books 😉
    Now if I would only read a few 😉
  4. #5
    Hehe, I knew what it was called. ;-) I just didn't want to use that word. 😛

    BTW, that presentation is really cool. Way better than anything I ever found.

    I have the cool scripts for linux book and the cool scripts for php book. Both have info on scraping, but that is straight forward.

    My problem with scraping is trying to figure out all those darn Regular Expressions. I use to be ok with them, but I am so rusty any more that it takes me forever. I just need to suck it up and force myself to memorize all of them again.

  5. #6
    Atomm wrote:
    My problem with scraping is trying to figure out all those darn Regular Expressions. I use to be ok with them, but I am so rusty any more that it takes me forever. I just need to suck it up and force myself to memorize all of them again.



    From my bookmarks. Maybe these will help. They are programs that help you build the expression to use.

    Probably the best one:
    http://www.ultrapico.com/Expresso.htm

    Not sure I played with this one or not 😉
    http://weitz.de/regex-coach/

    I also have the Regular Expressions book by Oreilly. One of the best book on the subject.
    http://www.oreilly.com/catalog/regex/

    If you get this book, make sure it is the 3rd edition. Has some updates for web stuff in it.

    Regular Expressions are cool! 😉
  6. #7
    Great Stuff! Thank you!

  7. #8
    Atomm wrote:
    Great Stuff! Thank you!



    Edited above. Make that the 3rd edition.