WordPress.org

Plugin Directory

Changeset 394622


Ignore:
Timestamp:
06/08/11 15:57:08 (3 years ago)
Author:
Otto42
Message:

Fix importing of image tracking tags (the feed has these, the "post" feed does not). Ref: https://core.trac.wordpress.org/ticket/17623

File:
1 edited

Legend:

Unmodified
Added
Removed
  • blogger-importer/trunk/blogger-importer.php

    r332680 r394622  
    66Author: wordpressdotorg 
    77Author URI: http://wordpress.org/ 
    8 Version: 0.3 
     8Version: 0.4 
    99Stable tag: 0.3 
    1010License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     
    186186                            $parts = parse_url( $tag['attributes']['HREF'] ); 
    187187                            $blog['host'] = $parts['host']; 
    188                         } elseif ( $tag['attributes']['REL'] == 'edit' ) 
     188                        } elseif ( $tag['attributes']['REL'] == 'edit' ) { 
    189189                            $blog['gateway'] = $tag['attributes']['HREF']; 
     190                        } elseif ( $tag['attributes']['REL'] == 'http://schemas.google.com/g/2005#post' ) { 
     191                            $parts = parse_url( $tag['attributes']['HREF'] ); 
     192                            $blog['posts_host'] = $parts['host']; 
     193                            $blog['posts_path'] = $parts['path']; 
     194                        } 
    190195                    } 
    191196                    ++$i; 
     
    426431                $index = $struct = $entries = array(); 
    427432                $headers = array( 
    428                     "GET /feeds/posts/default?$query HTTP/1.0", 
    429                     "Host: {$blog['host']}", 
     433                    "GET {$blog['posts_path']}?$query HTTP/1.0", 
     434                    "Host: {$blog['posts_host']}", 
    430435                    "Authorization: AuthSub token=\"$this->token\"" 
    431436                ); 
    432437                $request = join( "\r\n", $headers ) . "\r\n\r\n"; 
    433                 $sock = $this->_get_blogger_sock( $blog['host'] ); 
     438                $sock = $this->_get_blogger_sock( $blog['posts_host'] ); 
    434439                if ( ! $sock ) return; // TODO: Error handling 
    435440                $response = $this->_txrx( $sock, $request ); 
Note: See TracChangeset for help on using the changeset viewer.