1 #include "testlibrss.h"
5 #include <tdeaboutdata.h>
6 #include <tdecmdlineargs.h>
7 #include <tdeapplication.h>
12 static const TDECmdLineOptions options[] =
14 { "+url", I18N_NOOP( "URL of feed"), 0 },
19 void Tester::test( const TQString &url )
22 connect( loader, TQ_SIGNAL( loadingComplete( Loader *, Document, Status ) ),
23 this, TQ_SLOT( slotLoadingComplete( Loader *, Document, Status ) ) );
27 void Tester::slotLoadingComplete( Loader *loader, Document doc, Status status )
29 if ( status == Success )
31 kdDebug() << "Successfully retrieved '" << doc. title() << "'" << endl;
35 kdDebug() << "Image: ";
36 kdDebug() << " Title: " << doc. image()-> title() << endl;
37 kdDebug() << " URL: " << doc. image()-> url() << endl;
38 kdDebug() << " Link: " << doc. image()-> link() << endl;
41 kdDebug() << "Articles:" << endl;
44 Article::List::ConstIterator it;
45 Article::List::ConstIterator en=list.end();
46 for (it = list.begin(); it != en; ++it)
48 kdDebug() << "\tTitle: " << (*it).title() << endl;
49 kdDebug() << "\tText: " << (*it).description() << endl;
53 if ( status != Success )
54 kdDebug() << "ERROR " << loader-> errorCode() << endl;
59 int main( int argc, char **argv )
61 TDEAboutData aboutData( "testlibrss", "testlibrss", "0.1" );
62 TDECmdLineArgs::init( argc, argv, &aboutData );
63 TDECmdLineArgs::addCmdLineOptions( options );
66 TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
67 if ( args->count() != 1 ) args->usage();
70 tester.test( args->arg( 0 ) );
75 #include "testlibrss.moc"
TQValueList< Article > List A list of articles.
|