I have a website which user has to be logged in to his/her account to view pages ... but I want to set meta tags (description, image and title) for only when someone shares the link on telegram ...
how should I do it ? thanks in advance.
Obtaining api_id Sign up for Telegram using any application. Log in to your Telegram core: https://my.telegram.org. Go to "API development tools" and fill out the form. You will get basic addresses as well as the api_id and api_hash parameters required for user authorization.
So. I'v found the answer by using server.com/test.php with contents:
file_put_contents("heh.txt", $_SERVER['HTTP_USER_AGENT']);
Then I gave the link to telegram inside a chat. the content of heh.txt was:
TelegramBot (like TwitterBot)
so you should use:
if($_SERVER['HTTP_USER_AGENT'] === "TelegramBot (like TwitterBot)"){
//do something
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With