Skip to content

Instantly share code, notes, and snippets.

View Aero-Blue's full-sized avatar
💭
Working on stuff...

Aero Blue Aero-Blue

💭
Working on stuff...
View GitHub Profile
@Aero-Blue
Aero-Blue / telegram-bot.py
Created March 24, 2020 23:51
Telegram bot made with Telethon that sends a message to all members of a specified group
from telethon.sync import TelegramClient
import asyncio
from os import path
# Logging configuration
def login(phone, api_id, api_hash):
global client
client = TelegramClient(phone, int(api_id), api_hash)
@Aero-Blue
Aero-Blue / parsing_messages.py
Created March 23, 2020 16:39
Parse bytes into message objects for further manipulation
def get_raw_messages(server):
message_ids = [
int(message_id.split(b" ")[0]) for message_id in server.list()[1]
]
raw_messages = [
b"\n".join(server.retr(message_id)[1]) for message_id in message_ids
]
return [
parser.BytesParser().parsebytes(raw_message) for raw_message in raw_messages
]
@Aero-Blue
Aero-Blue / inbox.py
Last active March 23, 2020 17:59
Class to preform a simple login to gmail via pop3
class Inbox:
@classmethod
def login(cls, username, password, smtp):
print(f"Connecting to {smtp}...")
server = poplib.POP3_SSL(smtp)
print(f"Logging in...")
server.user(username)
server.pass_(password)
print(f"Logged in as {username}!")
return server
@Aero-Blue
Aero-Blue / FXThread.java
Created March 11, 2020 01:57
Update UI with background operation (JavaFX, 8)
Thread thread = new Thread(() -> {
Runnable updater = () -> {
// update ui operation / last here
};
// perform background operations here
Platform.runLater(updater);
});
thread.setDaemon(true); // let application close
thread.start();
@Aero-Blue
Aero-Blue / telegram-send-msg.py
Created January 10, 2020 00:05
Example of sending messages using Telethon
with TelegramClient(PHONE_NUMBER, API_ID, API_HASH) as client:
user_list = ["@user1", "@user2", "@user3"]
for user in user_list:
client.send_message(user, "Some message") # Send message to each user
@Aero-Blue
Aero-Blue / telegram-group.py
Last active January 9, 2020 23:14
Get usernames of all Telegram members in a group
with TelegramClient(PHONE_NUMBER, API_ID, API_HASH) as client:
users = client.get_participants(input("Group Name: ")) # Get all members of a group
user_list = [user.username for user in users if user.username is not None]
print(user_list) # Print a list of members
@Aero-Blue
Aero-Blue / telegram-login.py
Created January 9, 2020 22:00
Simple Telegram login example
from telethon.sync import TelegramClient # Imports
API_ID = 123456
API_HASH = "cje94230424jlesaferj23432042cc"
PHONE_NUMBER = "+12345678900"
with TelegramClient(PHONE_NUMBER, API_ID, API_HASH) as client:
account = client.get_me() # All your account info
print(f"Logged in as {account.username}!") # Output to console

Keybase proof

I hereby claim:

  • I am aero-blue on github.
  • I am aeroblue (https://keybase.io/aeroblue) on keybase.
  • I have a public key ASCZ2IMZwEof3e4JxFDodWvOQj38vIUp9-ri3lCKEN2JsAo

To claim this, I am signing this object:

@Aero-Blue
Aero-Blue / reply.py
Last active August 1, 2019 21:03
Reply script
import argparse
from requests_html import HTMLSession
USERNAME = ""
PASSWORD = ""
CAPTCHA_CODE = ""
class Main:
def __init__(self):
@Aero-Blue
Aero-Blue / EasyCopyBTC.user.js
Created July 31, 2019 16:27
Automatically copies selected Bitcoin addresses to clipboard!
// ==UserScript==
// @name EasyCopyBTC
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Automatically copies selected Bitcoin addresses to clipboard!
// @author Aero Blue
// @match *://*/*
// @grant none
// ==/UserScript==