Skip to content

Why doesn't my code work? #132

@MAX1MDEV

Description

@MAX1MDEV

from kickapi import KickAPI
client = KickAPI(
client_id='',
client_secret=''
)

def get_top_streamers(limit=10):
try:
streams = client.streams.get_live_streams()
sorted_streams = sorted(streams, key=lambda x: x.viewer_count, reverse=True)[:limit]
print(f"Top {limit} live streamers:")
for i, stream in enumerate(sorted_streams, 1):
print(f"{i}. {stream.user_name} - Viewers: {stream.viewer_count}")

except Exception as e:
    print(f"{e}")

if name == "main":
get_top_streamers()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions