Code Monkey home page Code Monkey logo

books_finder's Introduction

Hi there ๐Ÿ‘‹

I'm Bruno, but you can also call me D'Luka (pronounced di luka);
currently majoring in Computer Science;
I do Flutter and stuff; currently learning React Native and Unity (see Pinned);
pronouns: he/him๐ŸŒˆ;
Brazilian ๐Ÿ‡ง๐Ÿ‡ท;
fun fact: I can speak 4 languages (pt, en, es, ko), but I'm bad at all of them.


books_finder's People

Contributors

bdlukaa avatar kkimj avatar moomink avatar nerdwarejimtim avatar niklasenberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

books_finder's Issues

JsonUnsupportedObjectError thrown for DateTime and Uri classes when using jsonEncode

Was attempting to dump the book query info to json locally for future use, kept hitting this error: JsonUnsupportedObjectError. I was able to get around it by converting the 'publishedDate' DateTime to a string and not serializing anything with a link.

Seems these two classes don't have a proper toJson method, might want to grab their string representation.

Seems google wants a secure http request now

From what I see it is still able to retrieve most of the data, only the image URL is not able to be retrieved.

Screen Shot 2021-03-31 at 8 16 30 PM

When I manually update the URL to use https instead of http it works fine.

Screen Shot 2021-03-31 at 8 22 47 PM

QueryType

We experienced some issues with fetching books without being able to filter them by specific query types (isbn, author etc).
I added QueryType as a parameter to query books and wrote some tests to confirm, see #15

publishedDate and Format Exception

If you try to search "google"

final List<Book> books = await queryBooks( 'google', maxResults: 3, printType: PrintType.books, orderBy: OrderBy.relevance, reschemeImageLinks: true, );

Link to web query

the second result is a book that has a different publishedDate format, i think ISO (2016-09-15T00:00:00+02:00) and it raises a format exception at books.dart line 241

day = int.parse(publishedDateArray[2]);

I think you can try to parse the date with something like

`DateTime? publishedDate =
DateTime.tryParse((json['publishedDate'] as String?) ?? '0000-00-00');

if (publishedDate == null) {
  final publishedDateArray =
      ((json['publishedDate'] as String?) ?? '0000-00-00').split('-');

  // initialize datetime variable

  if (publishedDateArray.isNotEmpty) {
    // initialize date
    int year = int.parse(publishedDateArray[0]);
    int month = 1;
    int day = 1;

    // now test the date string
    if (publishedDateArray.length == 1) {
      // assume we have only the year
      year = int.parse(publishedDateArray[0]);
    }
    if (publishedDateArray.length == 2) {
      // assume we have the year and maybe the month (this could be just a speculative case)
      year = int.parse(publishedDateArray[0]);
      month = int.parse(publishedDateArray[1]);
    }
    if (publishedDateArray.length == 3) {
      // assume we have year-month-day
      year = int.parse(publishedDateArray[0]);
      month = int.parse(publishedDateArray[1]);
      day = int.parse(publishedDateArray[2]);
    }
    publishedDate = DateTime(year, month, day);
  }
}`

If I can help in any mode please tell me (but I'm NOT a professional developer).

Adding subtitle parameter to BookInfo

Hi! We are using books_finder for our school project and noticed some book titles are split between the 'title' and 'subtitle' parameter that is retrieved in the .json from Google's API. We'd really like to use both to get the full title's of some of our books. I updated the BookInfo class and wrote a test for it, see #13

Just a question.

I know this is just pulling from an API, but any chance you know why some cover images are faded, while most are not?

For example the first 2 are faded, but then the rest are fine. I'm just displaying them using the URL provided from the search call.

Screen Shot 2021-09-02 at 4 57 10 PM

[BookInfo] Add toJson

Hello,
Thanks your GREAT packages.

How about add toJson() at BookInfo Class?
Thanks!

current test failed

โœ“ Get books
Expected: 'preview-1.0.0'
  Actual: '0.0.1.0.preview.0'
   Which: is different.
          Expected: preview-1. ...
            Actual: 0.0.1.0.pr ...
                    ^
           Differ at offset 0
package:test_api                 expect
main.<fn>

โœ– Get book with special id
โœ“ Get magazines
โœ“ Get magazine with special id
โœ“ Get toJson
โœ“ Get book with subtitle
Expected: 'harry potter and the philosopher\'s stone'
  Actual: 'harry potter and the sorcerers stone'
   Which: is different.
          Expected: ... r and the philosophe ...
            Actual: ... r and the sorcerers  ...
                                  ^
           Differ at offset 21
package:test_api                  expect
main.<fn>

โœ– Test QueryTypes
Exited (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.