Git Product home page Git Product logo

google-play-books-highlights-quiz's Introduction

Overview

This ReactJS web app is a way to encourage a sentimental e-book lover to look back at their highlights and notes, in the format of a quiz.

The quiz presents the user with a book quote that they highlighted, and challenges them to identify which book title it originates from.

Features:

  • Easy import of highlights and notes from Google Play Books. Import is only required the first time the app is loaded.
  • Displays any notes the user took for that highlight, the matching highlight color, and the date the highlight was made.
  • Each quote includes a link to the exact location of the quote in the e-book in Google Play Books.
  • Ability to "favorite" a quote to keep track of quotes you want to save and look back at later.
  • "Browse" mode that presents all highlights and notes in a clean UI, grouped by book title.

Demo

Quiz:

Importing highlights from Google Drive:

Highlights Browser:

The Inspiration

Google Play Books is an e-book reader with a feature that I enjoy: for each book in your library, it generates a Google doc which contains all of the highlights and notes you made in that particular book. I have always been a heavy e-book highlighter - whenever I read a line that catches my interest, sounds like good life advice to remember, or is something that aligns with my sense of humour, I highlight it and maybe even write a short note.

Normally, once I finish a book, I would have no particular reason to look back at the highlights and notes that I took. But this is sad, since what's the point of highlighting in the first place if I never look back at it? The goal of this highlights quiz is to refresh your mind with your past highlights while engaging in a bit of a challenge. Even just during my time developing this, it has been very satisfying to look back at the lines I've highlighted (and the occasional corresponding notes!).

Required Setup

In order for this application to work, a specific option needs to be activated in the settings page of the Google Play Books mobile application. (At the time of writing this, I don't believe this option is visible on the web version.)

Under settings, there is an option called "Save notes, highlights, and bookmarks in Google Drive". Clicking on this setting opens a text field for a folder name, which is set to the default of "Play Books Notes". For my application, the folder name currently is required to be "Play Books Notes" (the default). A future improvement will be to enable any folder name to be used, and the user will be able to select the specific folder from their Google Drive.

google-play-books-highlights-quiz's People

Contributors

briancherin avatar

Watchers

James Cloos avatar  avatar

google-play-books-highlights-quiz's Issues

Ensure favorites works with backend changes

In functions/googleDrive/gdriveNotesHelper.js, getQuotesListFromHTML() includes pushing a HighlightQuote object which includes a quoteIsFavorited field. This used to be done on the frontend and so the favorites status was pulled from local cache.

Possible approaches to ensure that favorited items are maintained as favorited:

  1. Modify the frontend to do this. (simpler)
    • After pulling the quotes from the cache or database, pull the latest favorites list from the database.
    • Loop through all quotes and if a quote's text is in the favorites list, mark it as a favorite locally.
  2. Modify the backend code. (more optimal)
    • Modify database structure. Instead of having a list of quotes for a book, it should be a dictionary where the key is a hash of the quote text and the value is the quote object (with the text and rest of the info about the quote). With this change, we can access the child for a particular quote in constant time if we know the text.
    • Update code for pushing new quote to database and for pulling it on the frontend. (because changed db structure)
    • When add/remove a quote as favorite, can get constant time access in database by doing highlights-><bookTitle>->quotes-><quoteHash>->quoteIsFavorited. Don't need separate favorites branch in db.
    • When we refresh the quotes list (i.e. if a new quote is added and we re-import a specific book doc), the quoteIsFavorited field should not be overwritten since the quote text will not have changed. (Make sure this is true.)
    • Frontend will just pull the list of quotes and be able to use the quoteIsFavorited field as it is, without relying on a separate database query.

Reduce memory usage of cloud function

Currently, loads all html files into a big list and then parses them all. Instead, load one file at a time and parse it, so we don't need to store everything in memory at once.

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.