Skip to content

Instantly share code, notes, and snippets.

View smaznet's full-sized avatar

Smaznet smaznet

View GitHub Profile
@smaznet
smaznet / getAdmins.php
Last active August 29, 2017 08:12
گرفتن تعداد ادمین های کانال تلگرام
<?php
function getAdminsCount($username,$token){
$html_site = file_get_contents('https://t.me/'.substr($username,1));
$htm = new DOMDocument();
$htm->loadHTML($html_site);
$finder = new DomXPath($htm);
$classname = 'tgme_page_extra';
$nodes = $finder->query("//*[contains(@class, '$classname')]");
$members = $nodes->item(0)->textContent;
@smaznet
smaznet / README.md
Last active June 1, 2021 11:04
اجرا کردن چندین تلگرام بر روی ابونتو

کد زیر رو دانلود یا کپی کنید بعدش تو ترمینال chmod +x tltweak.sh ./tltweak.sh

یه شماره وارد کنید مثلا ۲ که اسم تلگرامتون بشه Telegram 2 ایکون تو دسک تاپ ایجاد شد و همچنین تو منو اپ هاتون هم میاد

<?php
/**
* Created by PhpStorm.
* User: smaznet
* Date: 7/29/17
* Time: 5:59 PM
*/
header("HTTP/1.1 200 OK");// مهمه چون اگه نباشه تلگرام فک میکنه که سرورتون ارور داده دوباره درخواست میفرسته
define('DEBUG_CHAT','129377043'); // یوزرر ایدی شما یا کانال برای دیباگ
define("TOKEN_DEBUG",TOKEN);// توکن رباتتون
<?php
require_once ("../core/telegramhelper.php"); // git clone https://github.com/smaznet/simplePhpBot
$update=json_decode(file_get_contents("php://input"));
$TL=new telegramhelper("TOKEN");
}
if ($update instanceof stdClass){
telegramhelper::parseUpdate($update);
}
$TL->makeHTTPRequest('sendMessage',['text'=>$Text,'chat_id'=>$ChatId]);
@smaznet
smaznet / tofarsibot.php
Created June 5, 2017 10:18
ToFarsiBot
<?php
function doCnvert($text)
{
$text = remove_emoji($text);
$text = strtolower($text);
$result = file_get_contents("http://www.behnevis.com/php/convert.php?farsi=" . urlencode($text) . "&resulttype=json&responsetime=-1");
$res = implode(" ", array_values(json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $result), true)));
return $res;
}
import java.util.*;
public class Ch2
{
public static void main(String[] vars){
Scanner sc=new Scanner(System.in);
System.out.println("type n :\n");
int n=sc.nextInt();
System.out.println("type k :\n");
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);