# Instant View template for Telegram messenger

**URL:** https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991
**Category:** Feature
**Created:** [May 19, 2017, 1:39am UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991 "2017-05-19T01:39:17Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [May 19, 2017, 1:39am UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/1 "2017-05-19T01:39:17Z")

</div>

This feature request is to develop instaview template for Discourse.

Instaview is a feature in Telegram messenger that allows for instant content view right in Telegram without opening a link in a browser.

Launch:

> **[Instant Views for Everyone & a $200K Contest](https://telegram.org/blog/instant-view-contest-200K)**
>
> Introducing the Instant View Platform and a $200K contest to make the entire internet available in the Instant View format.

Specs:

> **[Instant View Manual](https://instantview.telegram.org/docs)**

As a result, Discourse topics will be instantly previewable in Telegram messenger.

Once developed, I guess it will work for all Discourse setups as the basic HTML structure generated is always the same.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 19, 2017, 1:40am UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/2 "2017-05-19T01:40:54Z")

</div>

How is this different than OpenGraph or oEmbed which we already support?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [May 19, 2017, 1:46am UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/3 "2017-05-19T01:46:55Z")

</div>

Is more like a Google Amp, but you create a set of rules that translates a webpage to their fast format.

Should be pretty easy, since one would start from the crawler view where HTML is pretty straightforward.

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [November 16, 2017, 3:51pm UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/4 "2017-11-16T15:51:53Z")

</div>

Any news regarding this? [@team](https://meta.discourse.org/groups/team)

Is this going to be implemented in a short-term period?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 16, 2017, 4:07pm UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/5 "2017-11-16T16:07:25Z")

</div>

Very much into it! may really be a game changer for forums who have their user base an active user of telegram.

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [March 11, 2018, 7:15pm UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/6 "2018-03-11T19:15:59Z")

</div>

> [@Falco](#):
>
> Should be pretty easy

So, is it in your road plan or not? 😅

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 11, 2018, 8:46pm UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/7 "2018-03-11T20:46:05Z")

</div>

No, this isn’t in the Discourse roadmap.

Also, this will never be a Discourse feature. It’s a bunch of parsing rules that lives in Telegram servers and must be submitted to their team for approval. And it’s a by domain thing, so every Discourse site would need to be submitted/approved.

So what someone from the community can do is create the rule for a topic page, and share it here on Meta so people who are interested can submit their sites using the same rules.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 9, 2019, 4:17am UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/8 "2019-04-09T04:17:20Z")

</div>

I created a **very basic** view that can render Discourse topics (only the OP).

Here is the ruleset if anyone wants to implement for their own website:

```xquery
~version: "2.1"

# Test so we work only on topic
?exists: /html/head/meta[@property="article:published_time"]
 
# Basic Data
body: /html/body/div/div/div[has-class("post")]
title: /html/body/div/h1/a
author: //b[@itemprop="author"]
author_url: //div[has-class("creator")]/span/a/@href
subtitle: //div[@id="breadcrumbs"]/div[last()]/a/span[last()]
image_url: //head/meta[@property="og:image"]/@content

# Telegram Compatibility

# img inside a is not allowed
@replace_tag(<span>): //a[has-class("lightbox")]

# img inside p is not allowed, so inline emojis
<pic>: //img[has-class("emoji")]
# and put real images into the main body
@split_parent: //p/img

```

It looks like this:

 ![Screenshot_20190409-011707_Telegram_X](https://global.discourse-cdn.com/meta/original/3X/0/5/05eab512e59741e1aeed14485b67a56de29eaf32.png) ![Screenshot_20190409-010426_Telegram_X](https://global.discourse-cdn.com/meta/original/3X/a/a/aac2c0c4e7213f9c12886f6ae570a8f0420832b3.png)

---

<div class="post-metadata">

### Author: ![AndreSpecker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrespecker/32/139050_2.png) [@AndreSpecker](https://meta.discourse.org/u/AndreSpecker)
#### Post date: [October 8, 2019, 1:37pm UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/10 "2019-10-08T13:37:56Z")

</div>

> [@Falco](#):
>
> I created a **very basic** view that can render Discourse topics (only the OP).

how i can use it in my discourse?

---

<div class="post-metadata">

### Author: ![b4oshany](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/b4oshany/32/176298_2.png) [@b4oshany](https://meta.discourse.org/u/b4oshany)
#### Post date: [May 8, 2021, 12:55pm UTC](https://meta.discourse.org/t/instant-view-template-for-telegram-messenger/62991/11 "2021-05-08T12:55:59Z")

</div>

I also wanted to know. How do I set this up?

@AndreSpecker, did you figure it out?
