Git Product home page Git Product logo

goodreadsrec's People

Contributors

sgpritam avatar srdg avatar subhradeepss avatar suvamprasd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

goodreadsrec's Issues

Customize errors instead of generic 404

Currently, exceptions occur in the following breakpoints:

  • Not enough books (<7) are listed in the similar_books API call : results in IndexError.
  • No recommendations could be found : results in an empty list.
  • The ID/ISBN search tag is invalid (current 404 page lists this reason to the user).

Include 3 separate error pages (add the .html files to templates directory) for the three different cases and render the proper templates for each case.

Fix ISBN search

The bug
Searching with any ISBN beginning with 0 crashes the app and redirect to a 404 page.

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://goodreadsrec.herokuapp.com/.
  2. Type in the search box any ISBN of a book starting with 0. For e.g., 0743203046, 0393318281, 0373792689 and select ISBN radio button. Hit Enter/click on Submit.
  3. App should redirect to the 404 page.

Expected behavior
App should have shown the recommendations.

Desktop (please complete the following information):

  • OS: [e.g. iOS] NA (any)
  • Browser [e.g. chrome, safari] NA (any)
  • Version [e.g. 22] NA (any)

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] NA (any)
  • OS: [e.g. iOS8.1] NA (any)
  • Browser [e.g. stock browser, safari] NA (any)
  • Version [e.g. 22] NA (any)

Resolution
The error stems from app.py:L30 where the information from the text box is stripped and converted to an integer to be stored in query_num. Remove the conversion to int and keep query_num as a string.

Modularize code in app.py

Extract a function from app.py:L17-18 and name it get_search_tag() which returns a list of recommendations(Ref #6).

Modify it to get_search_tag(search_by_id<boolean>) after implementing issue #3.

Use rerouting to customize URLs

Use the URL re-routing feature in Flask such that, when the user searches for a book with ISBN no. or the book ID (Ref : #3) the app should reroute the user in the following template:
https://goodreadsrec.herokuapp.com/ISBN/<isbn-no>
or
https://goodreadsrec.herokuapp.com/ID/<id-no> .

Create main()

Extract the following code snippet:
if __name__=="__main__": app.run()
to a main() method.

Write detailed pydoc

For each module, write a pydoc stating the purpose of the parameter arguments and it's functionality.

Check for missing book images and replace them with custom images

There are some instances where Goodreads does not have any proper images of the book (for instance, book ID 425) and instead returns a custom book image with its logo. Check for these cases and render the image to a custom book image without the logo.

As an advanced approach, invoke the google search API with the book name and retrieve a poster/image of the book and render it on the app.

Include mutli-searching feature in index.html and error pages

Currently, only the homepage, i.e. form.html has the search option to use ISBN or ID (Ref #1). The error page does not have any search option at all.
Enable the searching options in all the html pages available in templates, so that the user can search from any page of the app.

Enhance the template design

Make the app look more sleek. Responsive feature must not be compromised with. Other than that, feel free to customize the colours, look, design and user interaction in any way you see fit.

IMPORTANT : Before submitting the PR, take a screenshot/photo/video of your proposed design and post it on the #goodreadsrec channel of the discord server. Please wait for approval, on receiving which, you can submit the pull request.

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.