Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Too slow #33

Open
afk-mario opened this issue Jan 12, 2017 · 1 comment
Open

Too slow #33

afk-mario opened this issue Jan 12, 2017 · 1 comment

Comments

@afk-mario
Copy link

afk-mario commented Jan 12, 2017

Hi I'm trying to do a telegram bot using the goodreads API, the problem is the results are getting too late, so the responde id for the telegram message ID expired.

Is there something I can do to get the search results faster?

    if query:
        books = gc.search_books(q=query)
        for book in books:
            print(book.title)
            results.append(InlineQueryResultArticle(
                id=uuid4(),
                title=book.title,
                url=book.link,
                description=book.description,
                thumb_url=book.small_image_url,
                input_message_content=InputTextMessageContent(
                    query.upper())))

    update.inline_query.answer(results)
@CptanPanic
Copy link

The problem with search_books method is firstly the goodreads API is not that accurate in regards to searching, so it returns extra results even if you are specific. The this library goes through and calls API again for each result to get the full information.

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

No branches or pull requests

2 participants