Main Page | Namespace List | Class List | Directories | File List | Class Members | File Members

cHttpSearch Class Reference

Class used for HTTP requests and query handling. More...

#include <httpSearch.h>

List of all members.

Public Member Functions

 cHttpSearch ()
 Constructor.
std::string createURL (std::string title)
 Creates URL to be passed to google.
std::string getHtmlBody (std::string google_url)
 Gets HTML Body returned by google.
int extractLyricsUrl (std::string body)
 Extracts valid URLs from google's results.
std::string extractLyrics (std::string HtmlBody)
 Cleans HTML code from useless tags.
std::string StringsTagRemover (std::string body)
 Cleans HTML code from useless tags.


Detailed Description

Class used for HTTP requests and query handling.

Author:
Frodo
Since:
pre-alpha
This class is used to construct google's query, and to extract usable results. It also performs a HTML code cleaning, permitting to have a clean Lyric text that will be printed in the main text area.


Constructor & Destructor Documentation

cHttpSearch::cHttpSearch  ) 
 

Constructor.

This method create a new cHttpSearch object. This object is used to perform google's search and to extract usable results.

Author:
Frodo
Since:
pre-alpha
Precondition:
None.


Member Function Documentation

cHttpSearch::createURL std::string  title  ) 
 

Creates URL to be passed to google.

This method constructs an URL that will be used to perform a google search using currently played song title and the first_url and second_url strings.

Author:
Frodo
Since:
pre-alpha
Parameters:
title Song title.
Returns:
Complete URL to perform a google's search.
Precondition:
title != NULL.

cHttpSearch::extractLyrics std::string  HtmlBody  ) 
 

Cleans HTML code from useless tags.

This method cleans the given HTML body to permits its correct visualization in main text area.

Author:
Frodo
Since:
pre-alpha
Parameters:
HtmlBody Body of HTML page to be cleaned.
Returns:
Cleaned text.
Precondition:
HtmlBody != NULL.

cHttpSearch::extractLyricsUrl std::string  body  ) 
 

Extracts valid URLs from google's results.

This method extracts valid URLs from google's result and puts them into vector of cHttpResultsVector class.

Author:
Frodo
Since:
pre-alpha
Parameters:
body Body get using getHtmlBody()
Returns:
Number of results.
Precondition:
body != NULL.
See also:
getHtmlBody

cHttpResultsVector

cHttpSearch::getHtmlBody std::string  google_url  ) 
 

Gets HTML Body returned by google.

This method processes the request and gets the body of the page returned by Google. It uses ghttp lib.

Author:
Frodo
Since:
pre-alpha
Parameters:
google_url Url generated by createURL()
Returns:
Body of param 1 page.
Precondition:
google_url != NULL.
See also:
createURL

cHttpSearch::StringsTagRemover std::string  body  ) 
 

Cleans HTML code from useless tags.

This method cleans the given HTML body removing useless strings between certain tags.

Author:
Frodo
Since:
pre-alpha
Parameters:
HtmlBody Body of HTML page to be cleaned.
Returns:
Html without useless strings between tags
Precondition:
body != NULL.


The documentation for this class was generated from the following files:
Generated on Sun Mar 27 03:07:06 2005 for lirica. by  doxygen 1.3.9.1