Instant View template for Telegram messenger

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:

Specs:

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.

4개의 좋아요

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

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.

7개의 좋아요

Any news regarding this? @team

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

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

1개의 좋아요

So, is it in your road plan or not? :sweat_smile:

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.

6개의 좋아요

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:

~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:

10개의 좋아요

how i can use it in my discourse?

1개의 좋아요

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

@AndreSpecker, did you figure it out?

1개의 좋아요