mirror of
https://github.com/etienne-hd/lbc.git
synced 2025-12-06 01:28:36 +01:00
get_ad & get_user functions, extended user info (badges, feedback, pro), and new usage examples
This commit is contained in:
20
examples/get_user.py
Normal file
20
examples/get_user.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Get detailed information about a Leboncoin user using their user ID."""
|
||||
|
||||
import lbc
|
||||
|
||||
def main() -> None:
|
||||
# Initialize the Leboncoin API client
|
||||
client = lbc.Client()
|
||||
|
||||
# Fetch a user by their Leboncoin user ID
|
||||
# Replace the ID with a real one for testing
|
||||
user = client.get_user("01234567-89ab-cdef-0123-456789abcdef")
|
||||
|
||||
# Print raw user attributes
|
||||
print("User ID:", user.id)
|
||||
print("Name:", user.name)
|
||||
print("Pro status:", user.is_pro)
|
||||
print("Ads count:", user.total_ads)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user