A Python library for direct interaction with Twitter's unofficial API
Project description
x_lolo
x_lolo is a Python library that allows direct use of Twitter's (formerly X) unofficial API without intermediaries, enhancing security.
Key Features
- Direct interaction with Twitter's unofficial API
- Developed based on reverse engineering of the API
- Utilizes the HTTPS proxy mitmproxy for traffic analysis
- No dependency on web scraping tools like Selenium
- Automation capabilities for various Twitter interactions
Objectives
- Provide a simple Python interface to interact with Twitter's API
- Offer a secure alternative to traditional authentication methods
- Allow developers to access Twitter features without relying on third-party services
Project Status
The project is currently under development. It is designed for developers who need direct control over interactions with Twitter's API. Currently implemented features include:
- Authentication (login)
- Session management (save/load)
- Post creation and interaction
- User information retrieval
- Follower management
- Post retrieval
Example Usage:
from x_lolo.session import Session
# Method 1: Create a new session and login
new_session = Session()
new_session.login(
username_email="your_email@example.com",
password="your_password",
save_session_to="session_data.yaml",# Optional: save session for later use
)
# Method 2: Load an existing session
existing_session = Session(load_from="session_data.yaml")
# Create a post
post = existing_session.add_post("Hello, Twitter!")
# Get user information
user = existing_session.get_user_by_username("lolo")
print(f"User: {user.name}")
print(f"Followers: {user.followers_count}")
# Get current user information
me = existing_session.me()
print(f"My username: {me.username}")
# Get user's recent posts (with pagination)
user_posts = existing_session.get_user_posts("twitter", pagination_count=2)
for post in user_posts:
print(f"Post content: {post.text_content}")
print(f"Likes: {post.like_count}")
The project is hosted at: https://github.com/mohaskii/x_lolo_project/
Contributions are welcome!
Your help in making x_lolo better is greatly appreciated
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file x_lolo-0.1.18.tar.gz.
File metadata
- Download URL: x_lolo-0.1.18.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5a9fc017fee719d57f8e1a6fd778c79b1a808fec4962907048f7d4be304ffc3
|
|
| MD5 |
e9d90e33a545ed613a14c63be68823da
|
|
| BLAKE2b-256 |
3594acf481b3af343def5fa8839ebc92ef6bfed0a2436c472f8600fb8313ba31
|
File details
Details for the file x_lolo-0.1.18-py3-none-any.whl.
File metadata
- Download URL: x_lolo-0.1.18-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
866eb75e8bea250adb6da28eccfc67fa009c659218358ef1dcec04f94eb87d47
|
|
| MD5 |
53748533735243a36b9acf7574a7db2a
|
|
| BLAKE2b-256 |
0017d3c5ca449f1b7b25b61999844ee3605f21fa09400294c03790e8a12f1955
|