Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items printed as "[[...]]" #13

Open
tbowers opened this issue Oct 17, 2017 · 1 comment
Open

Items printed as "[[...]]" #13

tbowers opened this issue Oct 17, 2017 · 1 comment

Comments

@tbowers
Copy link
Contributor

tbowers commented Oct 17, 2017

The examples provided on the main page work fine for me. However they are based on building your items up individually and then passing them into the feed.

In my case I am walking a folder structure and building an items list. I think my modification is very straight forward however when I print the rss, I end up with "<title>[[...]]</title>" instead of my actual serialized items.

   share_urls = get_urls()
    items = []
    for share_url in share_urls:
        itunes_item = iTunesItem(
            author = author,
            image = logo_url,
            explicit = "yes",
            subtitle = "Test Subtitle",
            summary = description)

        item = Item(
                title = title,
                link = homepage,
                description = description,
                author = author,
                guid = Guid(homepage),
                pubDate = datetime.datetime(2014, 12, 29, 10, 00),
                enclosure = Enclosure(url=share_url, length=0, type=''),
                extensions = [itunes_item])

        items.append(items)

    itunes = iTunes(
        author = author,
        subtitle = description,
        summary = description,
        image = logo_url,
        explicit = "yes",
        owner = iTunesOwner(name = author, email = email))

    feed = Feed(
            title = title,
            link = homepage,
            description = description,
            language = "en-US",
            lastBuildDate = datetime.datetime.now(),
            items = [ Item(items) ], # <<<--- I feel like my main issue is here but I'm not sure what I'm doing wrong
            extensions = [itunes])

    print(feed.rss())
@darcosion
Copy link

Hello,

feed take in parameter items a list of items. the variable items is a type list. So you send a list of item surrounded by []. I think it will work better with items = items,. :-)

Kindly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants