title: LibCurl HTML to string
body: <p>I would like help in getting a website's HTML source and putting it into a string. That way I can search through the string and find certain text. The links to the pages will be put in a separate text file. </p>
  
  <p>This is what I have so far: </p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      string line;
      ifstream myfile("profiles.txt");
      if (myfile.is_open())
      {
          while (getline(myfile, line))
          { 
              Get_Html(line);
          }
          myfile.close();
      }
  
      system("PAUSE");
      return 0;
  
  }
  
  void Get_Html(string link)
  {
      size_t found;
      CURL* curl = curl_easy_init();
      if (curl)
      {
          // Tell libcurl the URL 
          curl_easy_setopt(curl, CURLOPT_URL, link);
          // Tell libcurl what function to call when it has data 
          curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,);
          // Do it! 
          CURLcode res = curl_easy_perform(curl);
          curl_easy_cleanup(curl);
  
          if (res == 0)
          {
              found = contents.find("Currently Online");
              if (found != std::string::npos){
                  cout &lt;&lt; "Currently Online!" &lt;&lt; endl;
              }
              found = contents.find("Currently In-Game");
              if (found != std::string::npos){
                  cout &lt;&lt; "Currently In-Game!" &lt;&lt; endl;
              }
              found = contents.find("Offline");
              if (found != std::string::npos){
                  cout &lt;&lt; "Currently Offline!" &lt;&lt; endl;
              }
              else
                  cout &lt;&lt; "NAH!!!" &lt;&lt; endl;
          }
  
          else
              cerr &lt;&lt; "Error: " &lt;&lt; res &lt;&lt; endl;
      }
  
  }
  </code></pre>