Plugin Directory

Changeset 1529299


Ignore:
Timestamp:
11/06/2016 11:53:52 PM (9 years ago)
Author:
vividlteam
Message:

bug fix: change parsing target(recently wordpress.org support's page dom structure was changed.)

Location:
thunder-port/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • thunder-port/trunk/readme.txt

    r1322798 r1529299  
    44Tags: plugin support, quick search, WordPress Plugin Support
    55Requires at least: 4.1
    6 Tested up to: 4.4
    7 Stable tag: 4.4
     6Tested up to: 4.6.1
     7Stable tag: 4.6.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5858= 1.0 =
    5959* initial version
     60
     61= 1.1 =
     62* change parsing target(recently wordpress.org's support dom structure was changed.)
  • thunder-port/trunk/thunder_port.php

    r1322070 r1529299  
    44Plugin URI: http://vividl.net
    55Description: This is a plugin for all wordpress plugin's support.
    6 Version: 1.0
     6Version: 1.1
    77Author: vividl
    88Author URI: http://vividl.net
     
    316316        $html = curl_file_get_html(''.$pluginurl.'/');
    317317       
    318         foreach($html->find('td') as $article) {
     318        foreach($html->find('ul') as $article) {
    319319            // get title
    320             $title = trim($article->find('a', 0)->plaintext);
     320            $title = trim($article->find('li', 0)->find('a',0)->plaintext);
    321321            $title1 = htmlentities($title);
    322322            $title = utf8_encode($title1);
    323323           
    324             $address = trim($article->find('a', 0)->href);
     324            $address = trim($article->find('li', 0)->find('a', 0)->href);
    325325            $i++;
    326326            if($title == '' ){
     
    346346
    347347            $i=0;
    348             foreach($html->find('td') as $article) {
     348            foreach($html->find('ul') as $article) {
    349349                // get title
    350                 $title = trim($article->find('a', 0)->plaintext);
     350                $title = trim($article->find('li', 0)->find('a', 0)->plaintext);
    351351                $title1 = htmlentities($title);
    352352                $title = utf8_encode($title1);
    353                 $address = trim($article->find('a', 0)->href);
     353                $address = trim($article->find('li', 0)->find('a', 0)->href);
    354354                $i++;
    355355                if($title == '' ){
     
    384384    $ret = array();
    385385   
    386     foreach($html->find('#pages') as $article) {
     386    foreach($html->find('.bbp-pagination-links') as $article) {
    387387        // get title
    388388        foreach($article->find('a') as $art) {
    389 
     389   
    390390            $title = trim($art->plaintext);
    391             $pos = strpos($title, 'Next');
    392             if($pos !== false) {
     391            // $pos = strpos($title, '→');
     392           
     393            if(!is_numeric($title)){
     394            // if($pos !== false) {
    393395
    394396            } else {
Note: See TracChangeset for help on using the changeset viewer.