Skip to content

Instantly share code, notes, and snippets.

View muhammedfurkan's full-sized avatar
🙃

M.Furkan muhammedfurkan

🙃
View GitHub Profile
## 6. Locate Elements By CSS Selector
<html>
<body>
<div class="round-button">Click Here</p>
</body>
<html>
div.round-button
get_div = driver.find_element_by_css_selector('div.round-button')
import aioschedule as schedule
import asyncio
from telethon import TelegramClient
with TelegramClient(
os.path.abspath(fileName),
config.getint("api", "api_id"),
config.get("api", "api_hash"),
connection_retries=15,
retry_delay=3,
@muhammedfurkan
muhammedfurkan / autoreplier.py
Created April 25, 2020 20:20 — forked from yi-jiayu/autoreplier.py
Automatic replies for Telegram (Updated for Telethon 1.6.2)
import time
from telethon import TelegramClient, events
# sample API_ID from https://github.com/telegramdesktop/tdesktop/blob/f98fdeab3fb2ba6f55daf8481595f879729d1b84/Telegram/SourceFiles/config.h#L220
# or use your own
api_id = 17349
api_hash = '344583e45741c457fe1862106095a5eb'
# fill in your own details here
@muhammedfurkan
muhammedfurkan / call.py
Created April 25, 2020 20:21 — forked from painor/call.py
Make a call using pyrogram
#This is taken from https://github.com/LonamiWebs/Telethon-calls/blob/master/calls.py and modified
import hashlib
import os
import random
from pyrogram import Client
from pyrogram.api.functions.messages import GetDhConfig
from pyrogram.api.functions.phone import RequestCall
from pyrogram.api.types import PhoneCallProtocol
@muhammedfurkan
muhammedfurkan / split.py
Created April 25, 2020 20:22 — forked from behf/split.py
split a long text into small chunks, it won't cut your words.
def split_message(text, length=4096, offset=200):
return [text[text.find('\n', i - offset, i + 1) if text.find('\n', i - offset, i + 1) != -1 else i:
text.find('\n', i + length - offset, i + length) if text.find('\n', i + length - offset,
i + length) != -1 else i + length] for
i
in
range(0, len(text), length)]
# Usage, Using Pyrogram
@muhammedfurkan
muhammedfurkan / match_youtube_playlist_regex.py
Last active December 26, 2020 21:41
youtube playlist checker
import re
def youtube_url_validation(url):
youtube_regex = (r'(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(playlist\?list=|embed/|v/|.\?)')
youtube_regex_match = re.match(youtube_regex, url)
if youtube_regex_match:
return "success"
return "error"
@muhammedfurkan
muhammedfurkan / main.c
Created December 26, 2020 21:36
diamond shape with English Alphabeth Letters from A to Z
#include <stdio.h>
#include <conio.h>
int main()
{
int r, c, k, m, i;
m = 26;
for (r = 1; r <= m - 1; r++)
{
i = 0;
for (c = 1; c <= m - r; c++)
@muhammedfurkan
muhammedfurkan / main.c
Created December 26, 2020 21:37
reverse number 0 to 99999
#include <stdio.h>
/* Iterative function to reverse digits of num*/
int reversDigits(int num)
{
int rev_num = 0;
while (num > 0)
{
rev_num = rev_num * 10 + num % 10;
num = num / 10;
@muhammedfurkan
muhammedfurkan / main.c
Created December 26, 2020 21:38
0 ile 10000 arasındaki sayıların basamaklarını bulmak
#include <stdio.h>
#include <conio.h>
int main()
{
int a;
float birler, onlar, yuzler;
printf("3 basamakli sayi girin: ");
scanf("%d", &a);
@muhammedfurkan
muhammedfurkan / main.c
Created December 26, 2020 21:40
check input number is perfect number ?
#include <stdio.h>
int isperfect(int input)
{
int sum = 0, value = input / 2;
do
{
if (input % value == 0)
sum += value;
value--;