Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • Zach Schmit
    Participant

    Hi,

    We are using the following shortcode to display the Google news RSS feed in the Pro plugin version 4.7.1.

    [srr_feed urls="https://news.google.com/rss/search?q=self-esteem&hl=en-US&gl=US&ceid=US:en" tab_titles="Android" color_style="twitter" filter_type="hide" filter_name="exclude_this" show_author=1 show_date=1 display_type=grid template="%%thumbnail%% %%metadata%% <h3>%%title%%</h3> %%description%%" grid_columns=4 show_author=0 thumbnail_position=cover read_more="Read More" count=20 thumbnail_size="200px" thumbnail_force="when_absent"]

    Unfortunately, it has stopped fetching new thumbnails for the news items. I have cleared all possible caches and it’s still not displaying them.

    <img src="https://ibb.co/CWJtsX6" alt="Screenshot of the grid display of news with same thumbnails." />

    We cannot share the page URL as it is only accessible with the member login.

    Please let us know your feedback on this.

    Thanks.

    Hi Zach,

    Thanks for using Super RSS Reader – PRO.

    It seems the RSS feed item URL in the feed https://news.google.com/rss/articles/CBMiS2h0dHBzOi8vc291dGhjb2FzdGhlcmFsZC5jby56YS80ODg0NzUvd2hhdHMtdGhlLWJpZy1kZWFsLWFib3V0LXNlbGYtZXN0ZWVtL9IBTmh0dHBzOi8vc291dGhjb2FzdGhlcmFsZC5jby56YS80ODg0NzUvd2hhdHMtdGhlLWJpZy1kZWFsLWFib3V0LXNlbGYtZXN0ZWVtL2FtcA?oc=5 is not HTTP redirected to the original site.

    Hence the thumbnail image is not picked.

    Looks like Google made this change recently.

    You can enter the above URL in this page https://www.redirect-checker.org/index.php and see that the page is not reaching the source page.

    Looks like Google has switched to Javascript based redirection. Redirection like this cannot be identified.

    I can’t think of any immediate solution for this. I would suggest find an alternate RSS feed for the same purpose or use different RSS feed source.

    I’ll update you if I found anything on this.

    Thanks,
    Aakash

    Zach Schmit
    Participant

    Hi Aakash,

    Thank you for bringing the issue with the RSS feed URL in Super RSS Reader – PRO to our attention. We appreciate your diligence in investigating this issue and providing us with detailed information.

    We understand that the thumbnail image is not being picked due to the recent change made by Google, and that there is no immediate solution available for this. We would like to know if this issue is a priority for you and your team, and what timeline you have in mind for fixing this issue.

    Thanks.

    Hi Zach,

    Regarding the issue, the feature (fetching thumbnail from source website) itself works as expected without any issue.

    It is that the URL in the feed item does not redirect to the original source article.

    Super RSS Reader works with any RSS feed and not specific to Google news RSS feed.

    Since Google RSS feed had changed the redirect logic, some specific logic must be added just for this Google news RSS feed. Other RSS feeds don’t need that.

    This would be a custom requirement. I might need a week or so to think and work on this.

    I’ll share a code once it is complete.

    Thanks,
    Aakash

    marty shue
    Participant

    Is there any update regarding this matter?

    Hi Marty,

    Please paste the code below in your theme’s function.php file.

    You can follow any method like in the below, if you are new to this

    Best methods to Insert Custom PHP code in WordPress?

    Since in your case the problem is with the RSS feed URL, I have written this personalized code to help you. Feel free to modify this as per your requirement.

    (updated recently)

    function srr_google_feed_meta( $meta, $feed_item ){
        
        $url = $feed_item->get_link();
        
        $cache_name = 'srr_gfou_' . md5( $url );
        $original_url = get_transient( $cache_name );
        
        if( $original_url === false ){
    
            $page_html = SRR_URL_Metadata::fetch_page_html( $url );
            $pattern = '/<a\s+[^>]*href="([^"]*)"[^>]*>/i';
    
            if ( preg_match( $pattern, $page_html, $matches ) ) {
                $original_url = $matches[1];
                if( get_option( 'srr_debug' ) ){
                    SRR_Admin::log( $original_url );
                }
                set_transient( $cache_name, $original_url, WEEK_IN_SECONDS );
            }
            
        }
        
        return SRR_URL_Metadata::get_meta_data( $original_url );
        
    }
    
    add_filter( 'srr_mod_metadata_image', 'srr_google_feed_meta', 10, 2 );

    Thanks,
    Aakash

    marty shue
    Participant

    Hi Aakash,

    I’ve implemented the code above and it works perfectly.

    THANK YOU!

    Hi Marty,

    Happy that it works! Cheers!

    Thanks,
    Aakash

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Fetching a single thumbnail for all Google RSS Feed.’ is closed to new replies.

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms