Package org.gudy.azureus2.plugins.utils.xml.rss

Examples of org.gudy.azureus2.plugins.utils.xml.rss.RSSItem


   *
   * @since 3.0.0.7
   */
  private boolean nextUpdate() {
    if (iterDownloaders.hasNext()) {
      ResourceDownloader downloader = (ResourceDownloader) iterDownloaders.next();
      downloader.addListener(this);
      downloader.asyncDownload();
      return true;
    }
    return false;
  }
View Full Code Here


              }
             
              setProgress( 0 );
             
              downloader.addListener(
                new ResourceDownloaderAdapter()
                {
                  public void
                  reportPercentComplete(
                    ResourceDownloader  downloader,
                    int          percentage )
View Full Code Here

       
        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());
View Full Code Here

       
        RSSItem[] items = channel.getItems();

        for ( int j=0 ; j<items.length; j++ ){
         
          RSSItem item = items[j];
         
          WebResult result = new WebResult(this,getRootPage(),getBasePage(),getDateParser(),"");
         
          result.setPublishedDate(item.getPublicationDate());
         
          result.setNameFromHTML(item.getTitle());
         
          URL cdp_link = item.getLink();
         
          if ( cdp_link != null ){
         
            result.setCDPLink(cdp_link.toExternalForm());
          }
         
          String uid = item.getUID();
         
          if ( uid != null ){
           
            result.setUID( uid );
          }
         
          boolean got_seeds_peers = false;
         
          SimpleXMLParserDocumentNode node = item.getNode();
         
          if ( node != null ){
           
            SimpleXMLParserDocumentNode[] children = node.getChildren();
           
View Full Code Here

                                      item_rssitem.setText("RSS Feed active but no torrents present");
                                      item_rssitem.setBackground(item_server.getBackground());
                                  }
                                  for (int j=0;j<items.length;j++){

                                      RSSItem item = items[j];
                                      if(View.rss_info != null && !View.rss_info.isDisposed()){
                                          item_rssitem = new TreeItem(item_server,SWT.NULL);
                                          item_rssitem.setText(item.getTitle());
                                          item_rssitem.setBackground(item_server.getBackground());
                                         
                                          item_torrent_desc = new TreeItem(item_rssitem,SWT.NULL);
                                          item_torrent_desc.setText(" [description] " +  item.getDescription());
                                          item_torrent_desc.setBackground(item_rssitem.getBackground());
                                         
                                          item_torrent_link = new TreeItem(item_rssitem,SWT.NULL);
                                          item_torrent_link.setText(" [link] " + item.getLink());
                                          item_torrent_link.setBackground(item_rssitem.getBackground());
                                     
                                          //popup menu
                                          Menu popupmenu_bookmark = new Menu(View.rss_info.getParent());
                                       
                                          final MenuItem InsertTorrent = new MenuItem(popupmenu_bookmark, SWT.PUSH);
                                          InsertTorrent.setText("Add Torrent to Azureus");
                                        InsertTorrent.addListener(SWT.Selection, new Listener() {
                                          public void handleEvent (Event e){
                                            try {
//                                               Check is the table is not disposed
                                                if(View.rss_info == null || View.rss_info.isDisposed())
                                                  return;
                                                //Get the selection
                                                TreeItem[] items = View.rss_info.getSelection();
                                               
                                                //If an item is selected (single click selects at least one)
                                                if(items.length == 1) {
                                                  //Grab selected item
                                                  int place = 0;
                                                    TreeItem item = items[0];
                                                  String torrent_URL = item.getText();
                                 
                                                      try
                                                      {
                                                          TreeItem parent_torrent = item.getParentItem();
                                                          if(parent_torrent.getText().startsWith("Azureus BitTorrent"))
                                                        {
                                                            place = 1;
                                                                                                                      }
                                                      }
                                                     
                                                      catch (Exception nullpoint) {
                                                          System.out.println("too high!");
                                                          place = 2;
                                                      }
                                                     
                                                      if(place == 0)
                                                      {
                                                          InsertTorrent.setEnabled(true);
                                                          TreeItem item_parent = item.getParentItem();
                                                          TreeItem[] items_children = item_parent.getItems();
                                                          for(int i = 0 ; i < items_children.length ; i++){
                                                              if(items_children[i].getText().startsWith(" [link]")){
                                                                  //System.out.println("LINK! " + items_children[i].getText().substring(8,items_children[i].getText().length()));
                                                                  String link = items_children[i].getText().substring(8,items_children[i].getText().length());
                                                                  link = link.substring(0,link.indexOf("?"));
                                                                 
                                                                  Downloader.torrent_getter(link,pluginInterface);
                                                              }
                                                             
                                                          }
                                                      }
                                                      else if (place == 1)
                                                      {
                                                          InsertTorrent.setEnabled(true);
                                                          TreeItem[] items_children = item.getItems();
                                                          for(int i = 0 ; i < items_children.length ; i++){
                                                              if(items_children[i].getText().startsWith(" [link]")){
                                                                  //System.out.println("LINK! " + items_children[i].getText().substring(8,items_children[i].getText().length()));
                                                                  Downloader.torrent_getter(items_children[i].getText().substring(8,items_children[i].getText().length()),pluginInterface);
                                                              }
                                                             
                                                          }
                                                      }
                                                      else if (place == 2)
                                                      {
                                                          InsertTorrent.setEnabled(false);
                                                          //insert message!
                                                        Shell shell = new Shell(View.display);
                                                      MessageBox messageBox = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);
                                                      messageBox.setText("Selection Error");
                                                      messageBox.setMessage("You have choosen a Tracker, please select a torrent from the tracker to load into Azureus");
                                                      int response = messageBox.open();
                                                      switch (response){
                                                      case SWT.YES:
                                                          shell.dispose();
                                                          break;
                                                      }
                                                      }
                                                 
                                                 
                                                  //Downloader.torrent_getter(torrent_URL,pluginInterface);
                                                 
                                                 
                                                }
                                                 
                                               
                                                 
                                          } catch (Exception e1) {
                                            e1.printStackTrace();
                                          }
                                          }
                                        });
                                     
                                        View.rss_info.setMenu( popupmenu_bookmark);

                                     
                                     
                                     
                                     
                                     
                                      }   
                                     
                                      SimpleXMLParserDocumentNode node = item.getNode();

                                     
                                      if(View.rss_info != null && !View.rss_info.isDisposed()){
                                          item_torrent_hash = new TreeItem(item_rssitem,SWT.NULL);
                                          item_torrent_hash.setText( " [hash]    " + node.getChild(
View Full Code Here

    props         = new propertyWrapper(_props );
    pluginDir       = _pluginDir;
    config         = new PluginConfigImpl(this,pluginConfigKey);
    given_plugin_id      = _plugin_id;
    plugin_version    = _plugin_version;
    ipc_interface      = new IPCInterfaceImpl( initialiser, plugin );
    state                 = new PluginStateImpl(this, initialiser);
   
    boolean verified   = false;
    boolean bad    = false;
   
View Full Code Here

  }
 
  public IPFilter
  getIPFilter()
  {
    return( new IPFilterImpl());
  }
View Full Code Here

 
  public Logger getLogger()
  {
    if ( logger == null ){
     
      logger = new LoggerImpl( this );
    }
   
    return( logger );
  }
View Full Code Here

    else {
      plug_msg = new MessageAdapter( message )//core created
    }
   
    RawMessage raw_plug = plug_encoder.encodeMessage( plug_msg );
    return new com.aelitis.azureus.core.networkmanager.RawMessage[]{ new RawMessageAdapter( raw_plug )};
  }
View Full Code Here

    return config;
  }


  public PluginConfigUIFactory getPluginConfigUIFactory() {
    return new PluginConfigUIFactoryImpl(config,pluginConfigKey);
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.utils.xml.rss.RSSItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.