User Tag List

Results 1 to 2 of 2

Thread: Web Site Searcher In C++

  1. #1
    Web Site Searcher In C++

    User Info Menu

    Web Site Searcher In C++

    set up a google,yahoo,bing web searcher also has a time an date on it also, the sources are on the bottom if u want to download heres the link

    Code:
    http://www.sendspace.com/file/ehxgvo
    Code:
    //Bl4Ck.KiD...'s Google Searcher
    #include <iostream>
    #include <string>
    #include <windows.h>
    
    using namespace std;
    
    string WebSearch(string query) {
      int i=0;
      for(i; i<query.size(); i++) {
      if(query[i]==' ') { 
      query=query.replace(query.find(" ",0), 1, "+"); 
      }
      else if(query[i]=='+') {
      query=query.replace(query.find("+",0), 1, "%2B");
      }
      }
      string url="http://www.google.com/search?q=";
      url.insert(url.size(), query);
      return url.c_str(); 
    }
    int main() {   
                   system("title Bl4Ck.KiD...'s Google Searcher");
                  system("color 81");
                  cout<<"Welcome To Bl4Ck.KiD...'s Google Searcher\n";
                  cout<<"Type Something In That You Would Like To Search On Google\n";
    
         SYSTEMTIME time;
         
         GetLocalTime( &time );
         int hour = time.wHour;
         
         if (hour > 12) hour -= 12;
         
         cout << time.wMonth << "/" << time.wDay << "/" << time.wYear << endl;
         cout << hour << ":" << time.wMinute << endl;    string s;
        getline(cin,s);
        s=WebSearch(s);
        ShellExecute(NULL, "open", s.c_str(), NULL, NULL, SW_SHOWNORMAL);
        return 0;
    }
    Code:
    //Bl4Ck.KiD...'s Yahoo Searcher
    #include <iostream>
    #include <string>
    #include <windows.h>
    using namespace std;
    
    string WebSearch(string query) {
      int i=0;
      for(i; i<query.size(); i++) {
      if(query[i]==' ') { 
      query=query.replace(query.find(" ",0), 1, "?"); 
      }
      else if(query[i]=='+') {
      query=query.replace(query.find("+",0), 1, "%2B");
      }
      }
      string url="http://search.yahoo.com/search;_ylt=";
      url.insert(url.size(), query);
      return url.c_str(); 
    }
    int main() {   
                   system("title Bl4Ck.KiD...'s Yahoo Searcher");
                  system("color 81");
                  cout<<"Welcome To Bl4Ck.KiD...'s Yahoo Searcher\n";
                  cout<<"Type Something In That You Would Like To Search On Yahoo\n";
         SYSTEMTIME time;
         
         GetLocalTime( &time );
         int hour = time.wHour;
         
         if (hour > 12) hour -= 12;
         
         cout << time.wMonth << "/" << time.wDay << "/" << time.wYear << endl;
         cout << hour << ":" << time.wMinute << endl;    string s;
        getline(cin,s);
        s=WebSearch(s);
        ShellExecute(NULL, "open", s.c_str(), NULL, NULL, SW_SHOWNORMAL);
        return 0;
    }
    Code:
    //Bl4Ck.KiD...'s Bing Searcher
    #include <iostream>
    #include <string>
    #include <windows.h>
    using namespace std;
    
    string WebSearch(string query) {
      int i=0;
      for(i; i<query.size(); i++) {
      if(query[i]==' ') { 
      query=query.replace(query.find(" ",0), 1, "&"); 
      }
      else if(query[i]=='+') {
      query=query.replace(query.find("+",0), 1, "%2B");
      }
      }
      string url="http://www.bing.com/?scope=web&mkt=en-US&FORM=BWFD";
      url.insert(url.size(), query);
      return url.c_str(); 
    }
    int main() { 
                       system("title Bl4Ck.KiD...'s Bing Searcher");
                  system("color 81");
                  cout<<"Welcome To Bl4Ck.KiD...'s Bing Searcher\n";
                  cout<<"Type Something In That You Would Like To Search On Bing\n";
         SYSTEMTIME time;
         
         GetLocalTime( &time );
         int hour = time.wHour;
         
         if (hour > 12) hour -= 12;
         
         cout << time.wMonth << "/" << time.wDay << "/" << time.wYear << endl;
         cout << hour << ":" << time.wMinute << endl;    string s;
        getline(cin,s);
        s=WebSearch(s);
        ShellExecute(NULL, "open", s.c_str(), NULL, NULL, SW_SHOWNORMAL);
        return 0;
    }
    Get At Me Bl4Ck.KiD... Aka BK
    Future Rapper - Spits Fire
    Psp Coder - Mips, C
    Web Designer - HTML, Javascript, Some PHP
    Computer Programmer - Currently Learning C/C++, Visual Basic, Pascal, Brainfuck, Python, Ruby

  2. #2
    Web Site Searcher In C++

    User Info Menu

    Re: Web Site Searcher In C++

    I dislike your bracket formatting. I prefer:

    Code:
    method
    {
    //crap here
    }
    instead of
    Code:
    method{
    //crap here
    }
    but it's a personal choice.

    Other then that pet peeve, nice work!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •