Thread: Can I make a program on c++ that "gets online"

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    118

    Can I make a program on c++ that "gets online"

    Lets say I want to make a program that goes to google and searches for a word, can I do that with c++ or do I need to learn some other language?
    Why drink and drive when you can smoke and fly?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    Yes.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    118
    cool, thanks.

    does anyone have a tutorial to get me started?
    Why drink and drive when you can smoke and fly?

  4. #4
    Registered User
    Join Date
    Mar 2004
    Posts
    220
    Yes it is possible in many ways. I guess the easiest off hand would be to use the system() function and just build the appropriate url in a string.
    OS: Windows XP Pro CE
    IDE: VS .NET 2002
    Preferred Language: C++.

  5. #5
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    Check out the network programming board. There's a sticky there with some links and stuff...
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  6. #6
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    234
    Google offers code that can be obtained to make your own googleGUI. However, you must contact them and provide some valid intentions on using it for valid reasons and they will give you a coveted developer's key, which is needed to perform out-of-browser queries, I believe. Examine how google's code works, man! Its easy! lets learn:

    http://www.google.com/search?q
    =dog&sourceid=opera&num=0&ie=utf-8&oe=utf-8

    Okay. First the <http://www.> This specifies that a complete address for a URL
    Second <google.com> This is the website
    Third </search?q=> this specifies that a search is requested and the "q=" is "query="
    Fourth <dog> is what was searched for
    Fifth <&sourceid=opera> This is asking where the query is coming from so the scripts know how to return the response

    Sixth <&num=0&ie=utf-8&oe=utf-8> Forgot what most of this meant but I know it deals with the UFT-8 encoding...

    Most of the important parts are covered now just build and WIN32 app with some values and strings and and send through a WIN32 control (easiest for me) and you're done. If you want to return the results directly to your program...ask and you shall recieve (but not from me)

    ***REQUESTING A MODDY TO MOVE THIS TO ANTOHER BOARD
    Weeel, itss aboot tieme wee goo back too Canada, eeehy boyss.

  7. #7
    Registered User
    Join Date
    Mar 2004
    Posts
    5
    Mhm, First off all.. Easiest way for a beginner is just to study how the Google requests work as jinx made a good example off. Then when you know the basics, only to search normal as you wanted. You get alot of choises to do the request on. Some of those choices is:
    1. WinSock/Socket programming (Socket programming)
    2. Using browser for opening the page

    In the first choice (WinSock/Socket programming) you should learn how to use sockets and how to operate with them in your operating system. If you've Windows you should read about WinSock. Not hard only some simple initializing and outilazing functions. (WSACleanup(), WSAStartup()..)

    In the second example I would just use some simple code as ShellExecute in win32 or execv() in Linux.. Check up some great programming tutorials to get to work.. And I could give you some examples if you want.. ([email protected])

    Regards,
    Prof. Simen Pisal Kier @ UiO

  8. #8
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    First the <http://www.> This specifies that a complete address for a URL
    Actually this is two parts. http:// defines the protocol to use. www specifies to use the www subdomain on the host. If you wanted to break it up even more http specifies the protocol and // specifies a computer outside of your network.

  9. #9
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    234
    Google Hacks projects

    Google Hacks Book

    The last one has some nifty samples to play around with but I think that most of them are in a web-oriented language (php, html, etc.) Hope it helps.

    P.S. I got the book at my library and read through it an was pretty impressed. You should make a point of checking it out.
    Weeel, itss aboot tieme wee goo back too Canada, eeehy boyss.

  10. #10
    sockets mad
    Join Date
    Mar 2002
    Posts
    126
    Quote Originally Posted by Thantos
    Actually this is two parts. http:// defines the protocol to use. www specifies to use the www subdomain on the host. If you wanted to break it up even more http specifies the protocol and // specifies a computer outside of your network.
    If you want to be even more picky the "www" doesn't specify a subdomain it specifies a DNS host record :P
    C/C++ Support IRC Channel

    Server: irc.dal.net Channel: #csupport

    Come along and help make it a great resource for the community.

  11. #11
    Registered User
    Join Date
    Mar 2004
    Posts
    220
    How about we recognize that all of us are smart and don't need to be picky? Thank you.

    As far as this topic goes, Google API seems quite good. I will have a look at it myself when I have some free time ^_^
    OS: Windows XP Pro CE
    IDE: VS .NET 2002
    Preferred Language: C++.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 03:30 PM
  2. Need help with this program I'm trying to make
    By Sshakey6791 in forum C++ Programming
    Replies: 14
    Last Post: 12-01-2008, 04:03 PM
  3. Replies: 9
    Last Post: 06-17-2008, 11:38 AM
  4. want to make this small program...
    By psycho88 in forum C++ Programming
    Replies: 8
    Last Post: 11-30-2005, 02:05 AM
  5. How To Make The Program Installed In Program Files Folder?
    By javacvb in forum Windows Programming
    Replies: 4
    Last Post: 11-05-2003, 05:33 PM