FileDocCategorySizeDatePackage
Test.javaAPI DocAzureus 3.0.3.43899Thu Jan 11 10:15:18 GMT 2007org.gudy.azureus2.pluginsimpl.local.utils.xml.rss

Test

public class Test extends Object implements org.gudy.azureus2.plugins.Plugin
author
parg

Fields Summary
private static org.gudy.azureus2.core3.util.AESemaphore
init_sem
private static org.gudy.azureus2.core3.util.AEMonitor
class_mon
private static Test
singleton
protected org.gudy.azureus2.plugins.PluginInterface
plugin_interface
Constructors Summary
Methods Summary
public static org.gudy.azureus2.pluginsimpl.local.utils.xml.rss.TestgetSingleton()

		
	
	  
	
	
		try{
			class_mon.enter();
		
			if ( singleton == null ){
				
				new AEThread( "plugin initialiser" )
				{
					public void
					runSupport()
					{
						PluginManager.registerPlugin( Test.class );
		
						Properties props = new Properties();
						
						props.put( PluginManager.PR_MULTI_INSTANCE, "true" );
						
						PluginManager.startAzureus( PluginManager.UI_SWT, props );
					}
				}.start();
			
				init_sem.reserve();
			}
			
			return( singleton );
			
		}finally{
			
			class_mon.exit();
		}
	
public voidinitialize(org.gudy.azureus2.plugins.PluginInterface _pi)

	
		plugin_interface	= _pi;
		
		singleton = this;
		
		init_sem.release();
		
		try{
			RSSFeed feed = plugin_interface.getUtilities().getRSSFeed(new URL("http://aelitis.com:7979/rss_feed.xml"));
			
			RSSChannel[]	channels = feed.getChannels();
			
			for (int i=0;i<channels.length;i++){
				
				RSSChannel	channel = channels[i];
				
				System.out.println( "chan: title = " + channel.getTitle() + ", desc = " + channel.getDescription() +
									", link = " + channel.getLink() + ", pub = " + channel.getPublicationDate());
				
				RSSItem[]	items = channel.getItems();
				
				for (int j=0;j<items.length;j++){
					
					RSSItem	item = items[j];
					
					System.out.println( "    item:" + item.getTitle() + ", desc = " + item.getDescription() + ", link = " + item.getLink());
					
					SimpleXMLParserDocumentNode	node = item.getNode();
					
					System.out.println( "        [hash] " + node.getChild( "torrent_sha1" ).getValue());
					System.out.println( "        [size] " + node.getChild( "torrent_size" ).getValue());
					System.out.println( "        [seed] " + node.getChild( "torrent_seeders" ).getValue());
					System.out.println( "        [leec] " + node.getChild( "torrent_leechers" ).getValue());
				}
			}
							
		}catch( Throwable e ){
			
			e.printStackTrace();
		}
	
public static voidmain(java.lang.String[] args)

		getSingleton();