Skip to content

Return list of expanded URLs instead of just the string of only the first URL #14

@hauselin

Description

@hauselin

Hi, I noticed in the line below the code only returns the first expanded URL (urls[0]), and returns it as a string. Often, there are multiple URLs, so it would be great if all expanded URLs in any given tweet were returned. See the suggestion below. Thanks!

expanded_url = urls[0].get('expanded_url', None) if urls else None

# current: returns string and returns only the first expanded URL
expanded_url = urls[0].get("expanded_url", None) if urls else None

# suggestion: returns list of all expanded URLs
expanded_urls = [url.get("expanded_url") for url in urls if url.get("expanded_url")]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions