Created
June 28, 2021 19:24
-
-
Save MihailPreis/df1e1acad5efa092a3b42725086ceab4 to your computer and use it in GitHub Desktop.
Ghost random Telegram post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="tg-post"></div> | |
<script> | |
let GROUP_NAME = "" | |
let MIN_POST_ID = 3 | |
let MAX_POST_ID = 100 | |
function randomIntFromInterval(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min) | |
} | |
let post_id = randomIntFromInterval(MIN_POST_ID, MAX_POST_ID); | |
var script = document.createElement('script'); | |
script.src = "https://telegram.org/js/telegram-widget.js?15"; | |
script.async = true; | |
script.setAttribute('data-telegram-post', GROUP_NAME + "/" + post_id) | |
script.setAttribute('data-width', "100%") | |
script.setAttribute('data-color', "343638") | |
script.setAttribute('data-dark-color', "FFFFFF") | |
document.getElementById('tg-post').appendChild(script); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment