Instant View template for Telegram messenger

סיכום מבוסס בינה מלאכותית

The discussion revolves around creating an Instant View template for Discourse to enable instant content preview in Telegram without opening links in a browser. Users express interest in the feature, with meglio initiating the request and Falco explaining that it involves submitting parsing rules to Telegram, which is a domain-specific process. Falco clarifies that this is not a Discourse feature but a community-driven effort, and shares a basic template for rendering Discourse topics. The template focuses on extracting key elements like title, author, and image from the topic page. AndreSpecker and b4oshany inquire about implementation steps, indicating interest in using the template on their own Discourse sites.

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