Coder Social home page Coder Social logo

marvelcomiccovers's Introduction

MarvelComicCovers

A simple app built using Meteor that allows the user to compare two comic book covers and pick which one they like best

##Live Demo

See the live demo for an example of how the app works.

##Marvel API

Currently, the code to fetch data from the Marvel API is not active - meaning there is no call to the function that pulls the data from the Marvel database. The reason for this is that currently, Marvel caps the number of calls to its database to 3000 a day per apikey. When initially setup the demo, I made several calls to the function that pulls data from Marvel and then stored it into my own Meteor collection. This way, one can access the data without making calls to the Marvel database. Currently, in the demo database, there are about 2500 comic book issues - the Marvel database has thousands upon thousands. The plan is to completely copy their database; however, their API only allows 100 issues to be returned per one call.

###Getting Your Own API Key

You will need to go to Marvel's developer portal and register for an account. Upon successfull registration, you will be given a public and a private api key. When making calls to their API from a server (the way this app is setup), the HTTP parameteres require a unique hash for each call - the hash consists of a time stamp, the public key, and the private key. Please refer to the code in server.js, where the private and public keys are stored.

###Getting data from Marvel for your own app

If you clone this repository your app will not work as their will be no comic book data in the local Mongo db. You have two options - either a) clone the database that is in the dump folder, or b) build your own database using your own API key (as obtained above).

####Cloning the database The database dump is contained in the dump folder of this git repository. You can clone this database dump to your own local Mongo db that is setup when you create a meteor app. Refer to (mongo's documentation)[http://docs.mongodb.org/manual/] on how to do this. It's a rather tedious task, but you should be able to Google around for exact steps should you go this route.

####Building your own As mentioned above, the function pulling 100 titles at a time is already built in this app - however, there is currently no call to the function. Refer to server.js for the function, called "GetCovers". The function picks a random year and month between 1960 and 2013 and then stores all the titles that were puiblished for that month - with a maximum result of 100 (per Marvel's own limitations).

In order to wire this up to work on a fresh clone, you must make a call to this function from the client. You can do something like this in the covers.js file:

Template.covers.rendered = function(){
  Meteor.call('getCovers', function(error, result){
      //do stuff here regarding throwing errors or alerts upon successful insertion
  });
}

This should make it so that every time the "covers" template is rendered, 100 new titles are pulled from Marvel's database and inserted into the Meteor Comics collection.

The plan is to eventually set up an admin space when you click a button and it will iterate through the entire Marvel databse to refresh the titles, giving access to everything, but that is going to take a lot of calls and currently Marvel limits daily calls to 3000.

marvelcomiccovers's People

Contributors

ramsaylanier avatar

Stargazers

Alex Joffroy avatar  avatar Ben Strahan avatar Rushi Shah avatar

Watchers

James Cloos avatar  avatar  avatar

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.