WordPress.org

Plugin Directory

Changeset 524065 for feedwordpress


Ignore:
Timestamp:
03/26/12 22:28:54 (5 years ago)
Author:
radgeek
Message:

HTTP / Supply FeedWordPress ID in User-Agent string.

Location:
feedwordpress/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • feedwordpress/trunk/feedwordpress.php

    r524057 r524065  
    1212/** 
    1313 * @package FeedWordPress 
    14  * @version 2012.0322 
     14 * @version 2012.0326 
    1515 */ 
    1616 
     
    3535# -- Don't change these unless you know what you're doing... 
    3636 
    37 define ('FEEDWORDPRESS_VERSION', '2011.1024'); 
     37define ('FEEDWORDPRESS_VERSION', '2012.0326'); 
    3838define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact'); 
    3939 
  • feedwordpress/trunk/feedwordpress_file.class.php

    r455025 r524065  
    99    function __construct ($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { 
    1010        global $fwp_oLinks; 
    11          
     11        global $wp_version; 
     12 
    1213        $source = NULL; 
    1314        if (isset($fwp_oLinks[$url])) : 
     
    2021        $this->headers = $headers; 
    2122        $this->useragent = $useragent; 
    22          
     23 
    2324        $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE; 
    2425         
     
    3233                $args['headers'] = $this->headers; 
    3334 
    34             if ( SIMPLEPIE_USERAGENT != $this->useragent ) //Use default WP user agent unless custom has been specified 
     35            // Use default FWP user agent unless custom has been specified 
     36            if ( SIMPLEPIE_USERAGENT != $this->useragent ) : 
    3537                $args['user-agent'] = $this->useragent; 
     38            else : 
     39                $args['user-agent'] = apply_filters('feedwordpress_user_agent', 
     40                    'FeedWordPress '.FEEDWORDPRESS_VERSION 
     41                    .' (aggregator:feedwordpress; WordPress/'.$wp_version 
     42                    .' + '.SIMPLEPIE_NAME.'/'.SIMPLEPIE_VERSION 
     43                    .'; Allow like Gecko; +http://feedwordpress.radgeek.com/) ' 
     44                    . feedwordpress_display_url(get_bloginfo('url')), 
     45                    $this 
     46                ); 
     47            endif; 
    3648 
    3749            // This is ugly as hell, but communicating up and down the chain 
     
    5163             
    5264            endif; 
    53              
     65 
    5466            $res = wp_remote_request($url, $args); 
    5567 
Note: See TracChangeset for help on using the changeset viewer.