Thread: Possible Networking Program Design :: Winsock

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    Possible Networking Program Design :: Winsock

    Hello.

    I have an idea for a program I would like to design and implement using C++. This program will produce a list of websites based on what the user wants to search. For example, let say the user enters "c++ programming." The program will log onto Google.com and conduct a search for "c++ programming." It will browse all responses pages and save all websites into a text file (one line per website URL). One done, the user will have a list of relevant websites.


    From an implementation perspective, is the program above simple enough using C++ and Winsock? I should be able to setup a socket to connect to a search engine such as Google and/or Yahoo. That is about all I know right now. I do not know how to gather the information after I have connected to, say, a website. Please include a possible implementation using Winsock if you know of one.

    Thanks,
    Kuphryn

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Well, to be honest, I am new to that sort of programming too, but I do have a couple ideas....first, you will of course connect to the SE. Then, instead of sending a typical GET request, you instead send a CGI bin request parsed as necessary. The server then sends back the HTML page which will contain, among other things, the URLS of found pages. Then you will parse out the web addresses, carefull to distinguish between the desired ones from the ones randomly spread across the page <advertisements, etc....>

    But then you must somehow send a request for the "next" page to process, probably by reformatting the CGI request string slightly....anyway, that's my two cents.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Thanks.

    I anticipated a similar scenario.

    A member at one of the other forums I posted mentioned that Google support an API feature directly.

    Kuphryn

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    That seems odd - after all - how do you execute that function call remotely ?!!

    Interesting tho - I will look into it more when I have a little time...
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  3. Simple Networking Program in C
    By osal in forum C Programming
    Replies: 4
    Last Post: 05-30-2004, 11:46 AM
  4. C++: Reference Book, GUI, Networking & Beyond
    By kuphryn in forum C++ Programming
    Replies: 4
    Last Post: 11-10-2001, 08:03 PM