mirror of
git://projects.qi-hardware.com/vido.git
synced 2024-11-01 09:16:18 +02:00
limit output to one article (fix to problem in prior commit)
Signed-off-by: Mirko Lindner <mirko@qi-hardware.com>
This commit is contained in:
parent
6575416e60
commit
642a891998
16
src/vido.cc
16
src/vido.cc
@ -102,7 +102,7 @@ void set_html(const gchar *url){
|
|||||||
std::replace(term.begin(), term.end(), '+', ' ');
|
std::replace(term.begin(), term.end(), '+', ' ');
|
||||||
|
|
||||||
// // declare namespace
|
// // declare namespace
|
||||||
char* ns = "A";
|
char *ns = "A";
|
||||||
|
|
||||||
// // try to retrieve article
|
// // try to retrieve article
|
||||||
try {
|
try {
|
||||||
@ -117,13 +117,19 @@ void set_html(const gchar *url){
|
|||||||
|
|
||||||
// // get content html
|
// // get content html
|
||||||
content = article.getData().data();
|
content = article.getData().data();
|
||||||
|
|
||||||
|
// // get article length
|
||||||
|
int length = article.getArticleSize();
|
||||||
|
|
||||||
|
// // limit html output to article length
|
||||||
|
std::string str2 = content.substr (0,length);
|
||||||
|
|
||||||
// // emtpy gtkhtml widget
|
// // emtpy gtkhtml widget
|
||||||
gtk_html_flush(GTK_HTML(html_wg));
|
gtk_html_flush(GTK_HTML(html_wg));
|
||||||
|
|
||||||
// // load new data into gtkhtml widget
|
// // load new data into gtkhtml widget
|
||||||
gtk_html_load_from_string(GTK_HTML(html_wg), content.c_str(), -1);
|
gtk_html_load_from_string(GTK_HTML(html_wg), str2.c_str(), -1);
|
||||||
|
// std::cout<<term<<".\n";
|
||||||
}catch(...){
|
}catch(...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -163,7 +169,7 @@ void set_berlin(const gchar *url){
|
|||||||
}catch(...){
|
}catch(...){
|
||||||
}
|
}
|
||||||
|
|
||||||
// std::cout<<content<<".\n";
|
std::cout<<url<<".\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void articles2file(){
|
void articles2file(){
|
||||||
@ -224,7 +230,7 @@ int main(int argc, char **argv)
|
|||||||
window.show_all();
|
window.show_all();
|
||||||
|
|
||||||
show_random();
|
show_random();
|
||||||
|
// articles2file();
|
||||||
// set_berlin();
|
// set_berlin();
|
||||||
Main::run(window);
|
Main::run(window);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user