Access link previews from the Bot API - telegram

According to Telegram docs:
Link Preview is generated server-side
I'm trying to make a bot to process the info in the link preview for links sent by users, but I couln't find a way to get that information from the Bot API.
Is there any way to ask the API for the information the link preview shows?

Although there is no API method to get this information, Telegram uses the Open Graph Protocol to generate its Link Previews.
Any open graph client will provide the same information that Telegram shows in their Link Previews.

Is there any way to ask the API for the information the link preview shows?
The answer would be no. The Bot API cannot process the information in the link preview.
I'm trying to make a bot to process the info in the link preview for links sent by users
However if you want the bot to know what is on the other side of the link, It is possible. You can use a HTML content scrapping library and a Summarizing library to get a link preview. I have attached below the libraries you can use and a Reddit bot which is somehow close to what you need. The example libraries are in python but you can essentially get or make for the language you use.
python-goose is a HTML content scrapping library
python summarizing library
another python summarizing library
sample reddit bot
Telegram MessageEntity object

Related

How to send photos with self-destruct timer using Telegram Bot API?

In the Telegram app, you can send photos that self-destruct and can't be screenshotted by clicking on the clock icon before sending them. Is there any way to reproduce this behavior using the Telegram Bot API?
I'm using python-telegram-bot and couldn't find anything in its docs, but i'm not even sure if the API allows it. I could delete the messages after some time using bot.delete_message, however, the important part here is that the images shouldn't be screenshottable.
I'm using python-telegram-bot and couldn't find anything in docs, but i'm not even sure if the API allows it.
Telegram Bot API does not support such method yet.
I could delete the messages after some time using bot.delete_message, however, the important part here is that the images shouldn't be screenshottable.
Yes, bot can delete messages "manually" but there's no way to control the ability of making screenshots.

Update Telegram link preview programmatically

I have a bot which creates messages including some urls provided by users.
Telegram creates link previews for those urls. The previews are cached.
Sometimes the content of the url changes, then the preview provided by Telegram is outdated. So I need to update the link preview provided by Telegram.
Telegram link previews can be updated using https://telegram.me/webpagebot. But according to Telegram Bot API, a bot can't talk to another bot to avoid infinite loops. So opening a chat between my bot and webpagebot to request the update is not an option.
How could I force the update of a link preview from my bot? Is there some http request, API, or whatever to do it programmatically?
You may add a randomly generated variable to the end of the link, so Telegram looks a link as a new link, like this:
Suppose a old link is like:
https://example.com/offers/106-tatasky-recharge
If you change og_image, title, meta description of this page, then use the above link as:
https://example.com/offers/106-tatasky-recharge?t=18121980
I think, it solves the problem.

How to get a Telegram Bot to search documents posted in a channel?

I was getting started with telegram bots and I was wondering if there's a way to get a BOT to search through the files posted in a channel (and possibly download them, if the user asks for it).
For instance, if a BOT has a command "/search" and the user searches a file using certain keywords, then the BOT should answer with the requested file, if found on the channel, and it should also provide an internal link to download it.
I noticed that the APIs provide a getFile method that maybe could be useful in this case, I just wanted to know if this thing is achievable!
Hope I've made myself clear!

find out who watched my telegram Avatar

Recently, There are new robots that claim to be able to tell who has seen your profile photo but most of them are fake.
I want to know is it actually possible to write that bot? Directly by using bot api or indirectly like creating a channel for bot ...
This is not possible in Telegram, those bots just provide fake data.
You can't even know who views your channel post via either Client API, Bot API, or unofficial APIs.
I think all of these robots are fake and for ads. actually it's not useful that a robot tell who seen your profile photo. I think it is impossible.

Send Facebook message from application

How can I send a message to the currently logged in user from inside a Flex application contained in a Facebook iFrame and using the official AS3 Library for Facebook please?
To date the Graph API is the easiest way to work with facebook.
http://code.google.com/p/fbas/
It's far from a complete implementation, but Graph is so simple it shouldn't take long to implement any features you need.
NOTE: When I've used it I ported the javascript portion of the example code on the project's main page to AS3 & ExternalInterface. It reduced external dependencies to zero (with the exception of swfobject)
Facebook does not allow you to send messages . Either way , you can post to the user's friends feed on behalf of the user , with a custom message and the the notification for the post in feed will be displayed.
Post your request to http://graph.facebook.com/PROFILE_ID/feed
Requires the publish_stream permission.
You can refer this link http://facebooksdk.blogspot.com/2011/04/facebook-album.html

Resources