#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    166
    Rep Power
    12

    Question web output to variable?


    Ok, let me know if this makes sense. I have a webpage that i want to put the output of into a c++ variable. No webforms or anything like that, just like when i go to the webpage i want all the txt that is show into a variable. In perl its like this:

    Code:
    use LWP::Simple;
    my $variable=get("http://thewebpageiwant");
  2. #2
  3. not a fan of fascism (n00b)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Feb 2003
    Location
    ct
    Posts
    2,756
    Rep Power
    95
    you have to open a socket, connect to port 80 on the webserver, send a standard http request 'GET /index.hmtl HTTP/1.1\nHost:www.site.com\r\n', and then recv() the response. i bet you really appreciate perl now? :D
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    166
    Rep Power
    12
    yet another reason to hate microsoft! i wish i could compile perl into .exe's!
  6. #4
  7. not a fan of fascism (n00b)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Feb 2003
    Location
    ct
    Posts
    2,756
    Rep Power
    95
    you can. go search in the perl forum there is some way to do that i just dont remember how. but to do it in C wouldn't be hard at all really

IMN logo majestic logo threadwatch logo seochat tools logo