none
Cool browser source code reader! RRS feed

  • General discussion

  • I was looking through my downloaded curriculum and I started messing around with Network. Now all you have to do is type in a site, such as the word "google", and itll show source code.

    TextWindow.Clear()
    TextWindow.WriteLine("Url name?:")
    webpage="http://"+TextWindow.Read()+".com"
    content=Network.GetWebPageContents(webpage)
    Text.ConvertToUpperCase(content)
    TextWindow.WriteLine(content)

    Friday, May 10, 2013 8:41 PM

All replies

  • nice! one thing, though:

    i typed in "google", and it did bring up the source code. BUT. it closed once it finished reading it to the textwindow, making it impossible to read it.
    but still, it's very nice. :3 and very basic, too. 


    Small basic beginner today, expert tomorrow.

    Friday, May 10, 2013 11:40 PM
  • Thank you. This program should've stayed up and at the end of the code display, had the words "press any key to continue..."

    did this message not appear for you?

    Saturday, May 11, 2013 12:08 AM
  • I think it did at the end, but it closed anyway.
    I tinkered with several commands, and this one worked:

    TextWindow.Clear()
    TextWindow.WriteLine("Url name?:")
    webpage="http://"+TextWindow.Read()+".com"
    content=Network.GetWebPageContents(webpage)
    Text.ConvertToUpperCase(content)
    TextWindow.WriteLine(content)
    TextWindow.PauseIfVisible()



    Small basic beginner today, expert tomorrow.

    Saturday, May 11, 2013 12:23 AM
  • Cool, but I forgot to get rid of "Text.ConvertToUpperCase(content)" (you don't need this)

    but thanks for fixin' up this program!

    (look at "PLEASE READ!!!!")

    Saturday, May 11, 2013 12:33 AM
  • TextWindow.Clear()
    TextWindow.Title="Web Codeverter"
    TextWindow.ForegroundColor="Black"
    TextWindow.BackgroundColor="Green"
    TextWindow.WriteLine("Website NAME?")
    webpage="http://"+TextWindow.Read()+".com"
    content=Network.GetWebPageContents(webpage)
    TextWindow.Clear()
    TextWindow.WriteLine(content)
    TextWindow.PauseIfVisible()

    Here ya go!



    Saturday, May 11, 2013 12:36 AM
  • There! now it works just fine. :3 glad i could help, and it's good you changed the colors of the foreground and background. it makes it easier to see. 

    Small basic beginner today, expert tomorrow.

    Saturday, May 11, 2013 1:35 AM
  • If the contents of the webpage is to big for the TextWindow, you can insert a File.WriteContents(filepath,content) statement and study the site in a texteditor or even print it.

    On my computer the PauseIfVisible is unnessary (I get two "press any key to continue" messages and have to press two times. Without the Pause I get just one.


    Jan [ WhTurner ] The Netherlands

    Saturday, May 11, 2013 11:00 AM
    Answerer
  • Okay, thank you. If needed just delete pauseifvisible...

    Great file.writecontents idea! i cant wait!

    Saturday, May 11, 2013 1:45 PM