Created
November 29, 2019 09:26
-
-
Save fnzip/f46f14a35d383799330c534b113fd2f8 to your computer and use it in GitHub Desktop.
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="photo">😎</div> | |
<script> | |
/** | |
* Via (Android Browser) Custom Image | |
* | |
* Change image logo in via app with telegram photo profile | |
* | |
* How to use? Open Via > Settings > Customization > Logo > HTML Code, Then paste this script (change the username var with ur username) | |
* | |
* alfianokt || 29-11-1019 | |
*/ | |
// change with ur telegram username | |
const username = 'alfian_oktafireza' | |
// cors proxy (get content from another http host) | |
fetch('https://cors-masterkadal.herokuapp.com/https://t.me/' + username) | |
.then(async (res) => { | |
const text = await res.text() | |
const photo = /class="tgme_page_photo_image" src="(.+?)"/.exec(text)[1] | |
document.getElementById("photo").innerHTML = `<img src="${photo}" width="100px" style="border-radius: 50%; background-color: #FAFAFA;">` | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment