- Create a bot using @BotFather, get it's token
- Start conversation with bot
- Run following curl command
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
# Use this script to test that your Telegram bot works. | |
# | |
# Install the dependency | |
# | |
# $ gem install telegram_bot | |
# | |
# Run the bot | |
# | |
# $ ruby bot.rb | |
# |
# Start Bad Bot Prevention | |
<IfModule mod_setenvif.c> | |
# SetEnvIfNoCase User-Agent ^$ bad_bot | |
SetEnvIfNoCase User-Agent "^12soso.*" bad_bot | |
SetEnvIfNoCase User-Agent "^192.comAgent.*" bad_bot | |
SetEnvIfNoCase User-Agent "^1Noonbot.*" bad_bot | |
SetEnvIfNoCase User-Agent "^1on1searchBot.*" bad_bot | |
SetEnvIfNoCase User-Agent "^3D_SEARCH.*" bad_bot | |
SetEnvIfNoCase User-Agent "^3DE_SEARCH2.*" bad_bot | |
SetEnvIfNoCase User-Agent "^3GSE.*" bad_bot |
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
window.Clipboard = (function(window, document, navigator) { | |
var textArea, | |
copy; | |
function isOS() { | |
return navigator.userAgent.match(/ipad|iphone/i); | |
} | |
function createTextArea(text) { | |
textArea = document.createElement('textArea'); |
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
<?php | |
// Converts a number into a short version, eg: 1000 -> 1k | |
// Based on: http://stackoverflow.com/a/4371114 | |
function number_format_short( $n, $precision = 1 ) { | |
if ($n < 900) { | |
// 0 - 900 | |
$n_format = number_format($n, $precision); | |
$suffix = ''; | |
} else if ($n < 900000) { |
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
.sidebar_newsletter_sign_up, | |
.sidebar_subscribe, | |
.sign-up-form-single, | |
.signup-form--header, | |
.signup-with-checkboxes, | |
.skinny-sign-up, | |
.slidedown-newsletter, | |
.small-newsletter, | |
.social-link-mail, | |
.social_newsletter_box, |
function random_text( $type = 'alnum', $length = 8 ) | |
{ | |
switch ( $type ) { | |
case 'alnum': | |
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'alpha': | |
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'hexdec': |
<?php | |
// Replace EMAIL/API_KEY/ZONE_ID with your details. | |
// Zone ID is on the dashboard for the domain in the bottom right. | |
// Api keys are generated from the account settings. You must give cache purge permissions | |
// Place this script on your webserver and point a Github Webhook at it, and you'll clear | |
// the Cloudflare cache every time you do a push to GH. | |
$zoneId = "xxx"; | |
$apiKey = "xxx"; | |
$email = "xxx"; |