更改媒体大小:Blogger RSS提要上的缩略图 [英] Change size of media:thumbnail on Blogger RSS Feed

查看:65
本文介绍了更改媒体大小:Blogger RSS提要上的缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道帖子存在但确实存在似乎在这4年中,博客作者缩略图的生成方式有所更新.我已经尝试了几种方法,但是它们都不起作用,因此,如果有人可以帮助我找到解决问题的方法,我将不胜感激.

I know this post exists but it seems in those 4 years there have been updates to how bloggers thumbnails are generated. I've tried several approaches, but none of them work so if anyone could help me to find a solution for my problem I'd really appreciate it.

我想更改RSS feed抓取的博客文章的缩略图大小.现在,它使用的是 s72-c (72x72)大小的博客文章,我想将其替换为s1600版本.

I'd like to change the thumbnail size of my blogger posts that RSS feed grabs. Right now it's using the s72-c (72x72) sized version of my blogger posts and I'd like to replace those with the s1600 version.

从理论上讲,它应该很简单,但我无法使其正常工作.

In theory it should be simple, but I can't get it to work.

我尝试过

<script type='text/javascript'>
$img = el.find("thumbnail").attr("url");  //Get thumnail image from rss feed
$newText = $img.replace(/\/s72-c/, /\/s1600/);  //replace /s72-c with s1600
console.log($newText);
</script>

<script type='text/javascript'>
$(document).ready(function() {$(".post-thumb").attr("src", function(i, src) {return src.replace( "s72-c", "s1600" );});});
</script>

另一种解决方法也可以是在我的zapier代码中替换s72-c部分,然后再将其发布在不一致的通知上,但更可取的是解决此问题的核心.

Another workaround could also be to replace the s72-c part in my zapier code, before it's making the notification post on discord, but fixing the issue at it's core would be preferable.

推荐答案

尝试一下

document.querySelectorAll('img').forEach(function(img) {
    img.src = img.src.replace('/s72-c','/s1600');
});

这篇关于更改媒体大小:Blogger RSS提要上的缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆