Size: a a a

Instant View Russian

2020 November 25

T

Telman in Instant View Russian
А что это может быть?
источник

🎖

🎖🎖 Maksim³ in Instant View Russian
я думаю имеется ввиду открытые ссылки
источник

w

w3drt46523trc26 in Instant View Russian
Telman
Если вдруг кто-то не спит...
Скажите плиз...
У моего сайта podcasts.ru instant view отсутствует.
Но я тут заметил некую активность в сентябре —
>> отсутствует
а почему сам не запилишь?
источник

🎖

🎖🎖 Maksim³ in Instant View Russian
рекламку показывать святое дело
источник

T

Telman in Instant View Russian
w3drt46523trc26
>> отсутствует
а почему сам не запилишь?
Я пытался, заявку помогали мне туттделать
источник

T

Telman in Instant View Russian
Но в итоге все как-то забылось :(
источник

w

w3drt46523trc26 in Instant View Russian
там вроде простая верстка. за несколько минут все можно сделать
источник

w

w3drt46523trc26 in Instant View Russian
Telman
Я пытался, заявку помогали мне туттделать
источник

T

Telman in Instant View Russian
Illia Pyshniak
Хотел закинуть вам шаблон, авось примут. Но для этого нужно хотя бы 10 статей, так что пока не могу.

Вот код, вдруг нужен будет:
Вот...
источник

T

Telman in Instant View Russian
Можно его использовать — https://t.me/instantview_russian/135563 ?
источник

w

w3drt46523trc26 in Instant View Russian
вроде да. попробуй
источник

w

w3drt46523trc26 in Instant View Russian
🎖🎖 Maksim³
рекламку показывать святое дело
в собственные IV можно любую рекламу пихать (даже динамически, в принципе) и не переживать об адблокерах
источник

w

w3drt46523trc26 in Instant View Russian
Illia Pyshniak
~version: "2.1"
channel: "@p0dcasts"

# Apply template only for articles
?exists: //meta[@property="og:type"][@content="article"]
!path_not: (/(\?.*|index\.php(\?.*)?)?)?$
$main: //*[has-class("wpb_wrapper")]
body: $main//*[has-class("post_content")]
title: $main//h1

@json_to_xml: //script[@data-type = "application/ld+json"]
$published_date: //uploadDate
$published_date?: //datePublished
@remove: //xml
author: $main//a[has-class("post-author-name")]
author_url: $author/@href
published_date: $published_date

cover: $main//*[has-class("post_image")]/img


# ELEMENTS
@after(<br>): //blockquote/p
@set_attr(srcset, @data-srcset): //img

# EMBEDS
# Flourish Embed
<iframe>: //*[has-class("flourish-embed")]
@set_attr(src, "https://public.flourish.studio/", @data-src, "\\/embed"): $@

# Icons
<pic>: //img[(number(@width)) < 65]

# Big images in link
@if( "//a[descendant::img][ends-with(@href, \".jpeg\") or ends-with(@href, \".jpg\") or ends-with(@href, \".png\") or ends-with(@href, \".gif\") or ends-with(@href, \".JPEG\") or ends-with(@href, \".JPG\") or ends-with(@href, \".PNG\") or ends-with(@href, \".GIF\")]" )  {
 @set_attr(src, "./..//self::a/@href"): //a[not(@href = //link[@rel="canonical"]/@href) and not(@href = //meta[@property="og:url"]/@content)]//img
}

# Instagram as <blockquote>
@set_attr(src, @data-instgrm-permalink): //blockquote[has-class("instagram-media")]
<iframe>: $$


# HANDLERS
# Remove unwanted elements
?true
@remove: //button
@remove: //script
@remove: //xml
@remove: //img[ends-with(@src, ".svg")]
@remove: //img[starts-with(@src, "data:image")]
@remove: //pic[ends-with(@src, ".svg")]
@remove: //noscript

# Error Handler EMBED_ELEMENT_NOT_SUPPORTED
<unsupported>: //body[has-class("t-body")] # Tilda sites not supported
<unsupported>: $body//*[text()[contains(., "$latex")]]
<unsupported>: $body//div[has-class("apester-media")]
<unsupported>: $body//div[has-class("issuuembed")]
<unsupported>: $body//div[has-class("juxtapose")]
<unsupported>: $body//div[has-class("piktowrapper-embed")]
<unsupported>: $body//div[has-class("playbuzz")]
<unsupported>: $body//div[has-class("scrbbl-embed")]
<unsupported>: $body//div[has-class("quizz-container")]
<unsupported>: $body//div[starts-with(@class, "wtf-broadcast")]
<unsupported>: $body//div[has-class("articlevideo") and not(@data-type="instagram")]
<unsupported>: $body//script[contains(., "apester.") or contains(@src, "apester.")]
<unsupported>: $body//script[contains(., "playbuzz.") or contains(@src, "playbuzz.")]
<unsupported>: $body//script[contains(@src, "leaflet")]
<unsupported>: $body//script[contains(text(), "opinionstage")]
@unsupported:  $body//unsupported

# Error Handler NESTED_ELEMENT_NOT_SUPPORTED
$problems: $body
@while( $problems ) {
 $test: $body//*[self::*[has-class("fb-post")] or self::blockquote or self::aside or self::figure or self::img[not(./ancestor::figure)] or self::iframe[not(./ancestor::figure)] or self::script[@data-telegram-post] or self::slideshow[not(./ancestor::figure)] or self::video[not(./ancestor::figure)] or self::audio[not(./ancestor::figure)] or self::related or self::footer or self::table[not(ancestor::table) and not(descendant::table)]]
 $problems: $test/self::*[ancestor::anchor or ancestor::blockquote[not(contains(@class,"instagram"))] or ancestor::aside or ancestor::footer or ancestor::strong or ancestor::b or ancestor::em or ancestor::i or ancestor::ins or ancestor::u or ancestor::del or ancestor::s or ancestor::strike or ancestor::code or ancestor::kbd or ancestor::samp or ancestor::tt or ancestor::mark or ancestor::sup or ancestor::pic or ancestor::sub or ancestor::a or ancestor::reference or ancestor::h1 or ancestor::h2 or ancestor::h3 or ancestor::h4 or ancestor::h5 or ancestor::h6 or ancestor::p or ancestor::pre or ancestor::hr or ancestor::img or ancestor::br or ancestor::ul or ancestor::ol or ancestor::li]
 @split_parent: $problems
}
а ты вот эту жесть в конце прям во все шаблоны добавляешь?
источник

T

Telman in Instant View Russian
w3drt46523trc26
а ты вот эту жесть в конце прям во все шаблоны добавляешь?
какую жесть?
источник

w

w3drt46523trc26 in Instant View Russian
Telman
какую жесть?
там бОльшую часть кода занимают всякие фиксы и анпакеры
источник

T

Telman in Instant View Russian
w3drt46523trc26
там бОльшую часть кода занимают всякие фиксы и анпакеры
если бы я еще понимал о чем ты ))
источник

T

Telman in Instant View Russian
Мне Илья помог с этим кодом
источник

T

Telman in Instant View Russian
Illia Pyshniak
~version: "2.1"
channel: "@p0dcasts"

# Apply template only for articles
?exists: //meta[@property="og:type"][@content="article"]
!path_not: (/(\?.*|index\.php(\?.*)?)?)?$
$main: //*[has-class("wpb_wrapper")]
body: $main//*[has-class("post_content")]
title: $main//h1

@json_to_xml: //script[@data-type = "application/ld+json"]
$published_date: //uploadDate
$published_date?: //datePublished
@remove: //xml
author: $main//a[has-class("post-author-name")]
author_url: $author/@href
published_date: $published_date

cover: $main//*[has-class("post_image")]/img


# ELEMENTS
@after(<br>): //blockquote/p
@set_attr(srcset, @data-srcset): //img

# EMBEDS
# Flourish Embed
<iframe>: //*[has-class("flourish-embed")]
@set_attr(src, "https://public.flourish.studio/", @data-src, "\\/embed"): $@

# Icons
<pic>: //img[(number(@width)) < 65]

# Big images in link
@if( "//a[descendant::img][ends-with(@href, \".jpeg\") or ends-with(@href, \".jpg\") or ends-with(@href, \".png\") or ends-with(@href, \".gif\") or ends-with(@href, \".JPEG\") or ends-with(@href, \".JPG\") or ends-with(@href, \".PNG\") or ends-with(@href, \".GIF\")]" )  {
 @set_attr(src, "./..//self::a/@href"): //a[not(@href = //link[@rel="canonical"]/@href) and not(@href = //meta[@property="og:url"]/@content)]//img
}

# Instagram as <blockquote>
@set_attr(src, @data-instgrm-permalink): //blockquote[has-class("instagram-media")]
<iframe>: $$


# HANDLERS
# Remove unwanted elements
?true
@remove: //button
@remove: //script
@remove: //xml
@remove: //img[ends-with(@src, ".svg")]
@remove: //img[starts-with(@src, "data:image")]
@remove: //pic[ends-with(@src, ".svg")]
@remove: //noscript

# Error Handler EMBED_ELEMENT_NOT_SUPPORTED
<unsupported>: //body[has-class("t-body")] # Tilda sites not supported
<unsupported>: $body//*[text()[contains(., "$latex")]]
<unsupported>: $body//div[has-class("apester-media")]
<unsupported>: $body//div[has-class("issuuembed")]
<unsupported>: $body//div[has-class("juxtapose")]
<unsupported>: $body//div[has-class("piktowrapper-embed")]
<unsupported>: $body//div[has-class("playbuzz")]
<unsupported>: $body//div[has-class("scrbbl-embed")]
<unsupported>: $body//div[has-class("quizz-container")]
<unsupported>: $body//div[starts-with(@class, "wtf-broadcast")]
<unsupported>: $body//div[has-class("articlevideo") and not(@data-type="instagram")]
<unsupported>: $body//script[contains(., "apester.") or contains(@src, "apester.")]
<unsupported>: $body//script[contains(., "playbuzz.") or contains(@src, "playbuzz.")]
<unsupported>: $body//script[contains(@src, "leaflet")]
<unsupported>: $body//script[contains(text(), "opinionstage")]
@unsupported:  $body//unsupported

# Error Handler NESTED_ELEMENT_NOT_SUPPORTED
$problems: $body
@while( $problems ) {
 $test: $body//*[self::*[has-class("fb-post")] or self::blockquote or self::aside or self::figure or self::img[not(./ancestor::figure)] or self::iframe[not(./ancestor::figure)] or self::script[@data-telegram-post] or self::slideshow[not(./ancestor::figure)] or self::video[not(./ancestor::figure)] or self::audio[not(./ancestor::figure)] or self::related or self::footer or self::table[not(ancestor::table) and not(descendant::table)]]
 $problems: $test/self::*[ancestor::anchor or ancestor::blockquote[not(contains(@class,"instagram"))] or ancestor::aside or ancestor::footer or ancestor::strong or ancestor::b or ancestor::em or ancestor::i or ancestor::ins or ancestor::u or ancestor::del or ancestor::s or ancestor::strike or ancestor::code or ancestor::kbd or ancestor::samp or ancestor::tt or ancestor::mark or ancestor::sup or ancestor::pic or ancestor::sub or ancestor::a or ancestor::reference or ancestor::h1 or ancestor::h2 or ancestor::h3 or ancestor::h4 or ancestor::h5 or ancestor::h6 or ancestor::p or ancestor::pre or ancestor::hr or ancestor::img or ancestor::br or ancestor::ul or ancestor::ol or ancestor::li]
 @split_parent: $problems
}
Я отправил этот шаблон на проверку.
Он правда некоторые страницы все равно не обрабатывает, особенно те, в которых есть embed плееров от разных подкаст-приложений.
источник

M

Misho in Instant View Russian
Telman
А что это может быть?
это же стата для канала?
источник

M

Misho in Instant View Russian
ты кроме постов на сайте ничего в нем не кидаешь?
источник