shit code (that really saves the day)
166 subscribers
24 photos
6 videos
30 files
16 links
cooked scripts
Download Telegram
shit code (that really saves the day)
main: payment url host: host
Since this tool is currently exclusive to Node.js, I've received valuable feedback suggesting a simplified, single-function JavaScript version. This would enable seamless integration across multiple languages, initially targeting PHP and Python in this planned release.
😱4🀯1
user_database.php
3.3 KB
PHP library to manage users of a Telegram bot using TXT files

Author: @AveragePacket
how to use?

<?php
require_once 'user_database.php';

$db = new UserDatabase('users.txt');

# Register a new user
$db->registerUser(123456789, 'premium', 100, 15);

# Get user information
$user = $db->getUser(123456789);
print_r($user);

# Update user credits
$db->updateUser(123456789, ['CREDITS' => 50]);

# Delete a user
$db->deleteUser(123456789);
(useful for users who sell bot checker and don't want to kill their heads using SQL)
🀯3
Today’s updates are on hold as the admin is engaged elsewhere
πŸ‘€4
FileLoader.php
1 KB
FileLoader - Your Custom File Loading Class

FileLoader is a custom file loading class designed to handle file inclusion in your PHP projects in an efficient and orderly manner. This class enhances code readability and maintainability by providing a clear and consistent interface for file inclusion.

Advantages over require, require_once, and include?

simple, loaded Files Control, fileLoader keeps track of the files it has already loaded, preventing redundant file inclusion. This can improve performance, especially in large projects with many dependencies.

Custom Error Handling, unlike require and include, which generate warnings and continue running when they can’t include a file, FileLoader can throw exceptions that you can catch and handle in the way you prefer.
πŸ‘3
Ideal Use Cases?
FileLoader is perfect for PHP projects of any size that benefit from cleaner, more organized code. It’s especially useful in large projects with many file dependencies, where loaded files control and custom error handling can be very beneficial
How to use?

spl_autoload_register(function ($class_name) {
include $class_name . '.php';
});

# here you can now use your class without the need to include it manually
FileLoader::load('./path.php');


In this example, spl_autoload_register registers an anonymous function that will be executed every time you try to use a class that has not yet been defined. The anonymous function will include the file that matches the class name (assuming that each class has its own file and that the file name matches the class name) :[
🀯4
Therefore, you can use FileLoader without having to include it manually.PHP will automatically call the anonymous function to include FileLoader.php when you use the FileLoader.php class
well thank you all for watching, share the channel for more shitty codes 🫑
πŸ‘Œ3
api.php
1.3 KB
PHP script that generates real addresses for different countries using the FakeXy API.

download guzzle library
 composer require guzzlehttp/guzzle

$countryCodes = ['ar', 'au', 'bd', 'be', 'br', 'ca', 'cn', 'cz', 'fr', 'de', 'gr', 'hu', 'in', 'id', 'ir', 'it', 'jp', 'my', 'mx', 'np', 'nl', 'ng', 'pe', 'ph', 'pl', 'pt', 'ro', 'ru', 'sa', 'sg', 'za', 'kr', 'es', 'se', 'th', 'tr', 'ug', 'ua', 'gb', 'us', 'vn'];


(in case you are going to use it for bot)
like if you want me to do it in python
πŸ‘Œ4
output looks like
image_2024-07-12_13-14-29.png
4.5 KB
to be honest, my php files are fucked up, so I disabled the ssl certification in this line, if you get any error related to the ssl certification, leave it as default
$client = new Client();

, any other error consult my dm @AveragePacket
πŸ‘4