Size: a a a

Instant View Russian

2020 June 27

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
}
Это код шаблона?
источник

T

Telman in Instant View Russian
Спасибо!!!
источник

IP

Illia Pyshniak in Instant View Russian
Telman
Это код шаблона?
Ага

Если что сломается — пишите сюда, разберёмся.
источник

KG

Kirill Grinchuk 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
Illia Pyshniak
Ага

Если что сломается — пишите сюда, разберёмся.
СПАСИБО Илья! Большое!
источник

IP

Illia Pyshniak in Instant View Russian
Kirill Grinchuk
этот монстр предназначен для того, чтобы вытащить ив из чего угодно?)
Не из чего угодно, но да, часто хватает изменить main и body
источник

NS

Nikita Starshinov 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
}
надеялся, что ты это сделаешь)
источник

NS

Nikita Starshinov in Instant View Russian
неслабый у вас домен конечно
источник

T

Telman in Instant View Russian
Nikita Starshinov
неслабый у вас домен конечно
Спасибо. Год пытался его выкупить. :/
источник

d

denis in Instant View Russian
wholesome
источник

T

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

Вот код, вдруг нужен будет:
Нашел вот такую статью — https://poltavcev.biz/2018/06/05/instant-view-telegram-v-wordpress/
источник

T

Telman in Instant View Russian
Плагин даже для WP сделали — https://wordpress.org/plugins/vp-telegram-instant-view/
источник

IP

Illia Pyshniak in Instant View Russian
А, ну для этого (генерации ссылок https://t.me/iv?url=ССЫЛКА НА ВАШУ СТАТЬЮ&rhash=УНИКАЛЬНЫЙ ХЕШ ШАБЛОНА) проще всего @insvibot использовать

Он сразу спрячет эту ссылку в неразрывный пробел так, чтобы читателям она не бросалась в глаза

Но если так удобнее — то тоже можно
источник

NM

Nu Ma in Instant View Russian
Добрый день.  А как быть, когда шаблон сделан, и ... уже с год жду когда его рассмотрят.
источник

IP

Illia Pyshniak in Instant View Russian
Nu Ma
Добрый день.  А как быть, когда шаблон сделан, и ... уже с год жду когда его рассмотрят.
Ждать дальше, а заодно добавить сайт на участие в следующем конкурсе через кнопку Add Domain на instantview.telegram.org/contest

Вероятность, что ваш шаблон одобрят до конкурса почти нулевая
источник

NM

Nu Ma in Instant View Russian
добавил, конечно. ох. чУдная какая логика приемки IV.
источник

IP

Illia Pyshniak in Instant View Russian
Nu Ma
добавил, конечно. ох. чУдная какая логика приемки IV.
🤷
источник

NM

Nu Ma in Instant View Russian
Спасибо на добром слове
источник
2020 June 29

IP

Illia Pyshniak in Instant View Russian
один из больших банков в Украине. забавная история
источник

IP

Illia Pyshniak in Instant View Russian
Версия с покупкой страховки ОСАГО  доступна для всех клиентов monobank.

По этому случаю, придумали акцию!
Если вы застрахуетесь у нас и попадаете на автоматическую фиксацию штрафа за нарушение ПДД в течении 30 дней от даты покупки ОСАГО, мы оплатим один штраф за вас.

Акция действует до 1.08.2020
источник