diff --git a/src/vido.cc b/src/vido.cc index 8ae7e3d..b587160 100644 --- a/src/vido.cc +++ b/src/vido.cc @@ -100,9 +100,25 @@ void set_html(const gchar *url){ // // replace '+' signs with spaces in url std::replace(term.begin(), term.end(), '+', ' '); + +// // find and declare namespace + size_t found; + size_t found2; + char *ns; -// // declare namespace - char *ns = "A"; + found=term.find("/"); + if (found!=std::string::npos){ + if (found != (int) 0){ + ns = &term[0]; + }else{ + term = term.substr(1, strlen(url)); + ns = &term[0]; + found2 = term.find("/"); + term = term.substr(found2 + 1, strlen(url)); + } + }else{ + ns = "A"; + } // // try to retrieve article try { @@ -129,7 +145,8 @@ void set_html(const gchar *url){ // // load new data into gtkhtml widget gtk_html_load_from_string(GTK_HTML(html_wg), str2.c_str(), -1); -// std::cout<