📲 Template for display steemit in telegram messenger. "Instantview" mode

vikx(52)
Published in
#steemit
Words
109
Reading
1 min
Listen
Play
9y

"Mobile" telegram users have certainly appreciated the convenience of instant view pages in the mobile application Telegram.


Such pages are instantly opened in telegram chat and have already been adapted for easy viewing on the phone. In combination with bots through which you can publish and comment posts - this is almost a ready mobile application at a price of several lines of code! :)

I cite the template below, however, in order for it to work for all globally - the Steemit team (owners of the steemit.com domain) should check my code for security reasons and must publish it according to the instructions: https://instantview.telegram.org/#publishing-templates

Telegram instant view Template Code


Https://github.com/vikxx/golos-steemit-instant-telegram/blob/master/iv


?exists: /html/head/meta[@property="article:published_time"]
body:     //article
title:    $body//h1[1]
subtitle: $title/next-sibling::h2
image_url: $cover/self::img/@src
image_url: $cover/self::figure//img/@src
image_url://head/meta[@property="og:image"]/@content
<span>:  //blockquote[has-class("graf--pullquote")]//strong
<aside>: //blockquote[has-class("graf--pullquote")]
@inline: $body//iframe[starts-with(@src, "/media/")]
@combine(<br>,<br>): $body//pre/next-sibling::pre
@combine(<br>,<br>): $body//blockquote/next-sibling::blockquote
@remove: $body//ul[has-class("shareItems")]
$embed:           $body//div[has-class("graf--mixtapeEmbed")]
$embed_link:      $embed/a
@detach:          $embed_link/strong
@before_el(./..): $embed_link/*
@wrap(<cite>):    $embed_link
<blockquote>:     $embed
@remove: //article/header
@remove: //article/footer
@remove: $body//a[contains(@href,"/adServer.bs")]
@remove: $body//p//*[has-class("graf-dropCap")]//img[has-class("graf-dropCapImage")]
@remove: $body//section[1]//hr
@remove: $body//table
@remove: $body//section[has-class("section--first")]//hr
@remove: $body//section[has-class("section--cover")]/following-sibling::*[1]/self::section//hr
@remove: $body//section[has-class("is-backgrounded")]/following-sibling::*[1]/self::section//hr
@before(<hr>): $body//figure[.//img[number(@data-height) < 30][(number(@data-width) > number(@data-height) * 30)]]
@remove
📲 Template for display steemit in telegram messenger. "Instantview... | Ecency