davidchambers / tutor

JavaScript interface for the Gatherer card database
https://gatherer.wizards.com/
Do What The F*ck You Want To Public License
149 stars 18 forks source link

Tutor client-side in the browser #59

Open eeble opened 11 years ago

eeble commented 11 years ago

I know that the ability to run tutor client-side is on the roadmap somewhere. I'm just curious how this would happen. Given a little direction/ideas and free time, I'd be happy to try and tackle this.

davidchambers commented 11 years ago

The idea is to use YQL as a proxy using queries in the form:

select * from html where url='http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=195297'

Tutor would send this query to Yahoo in the form of an Ajax request (thanks to CORS). Yahoo would then kindly fetch the Gatherer document and provide its body to us in full.

The tricky part is using browserify to make Tutor run in both environments (server and browser). I've made a start on this, but it's a long way from finished.

eeble commented 11 years ago

Cool, I figured it was the 'request' module that was causing the issues as that was about as far as I got adding it into a browser page before things really blew up.

davidchambers commented 11 years ago

We'll need to use jQuery.ajax to make requests from the browser.

bernatfortet commented 11 years ago

Hey David, si this still on? I have moved my app to Meteor and I am having a lot of trouble to use an endpoint API on the server to get the cards. It would be great to have it on the client.

How can I help you?

davidchambers commented 11 years ago

My priorities are as follows:

  1. Maintenance:
    • stay on top of changes to Gatherer's output
    • add support for edge cases as they appear (e.g. double-faced cards)
    • fix existing Tutor bugs as they're reported
  2. Add search functionality
  3. Make Tutor work in the browser using YQL

How can I help you?

Most of Tutor's code will apply in both contexts, but certain areas will require special treatment. There are two tasks:

bernatfortet commented 11 years ago

Well, I'll see what I can do about it. I am excited to see it running on the browser.

Keep up the good work. Tutor is great!

GixGosu commented 8 years ago

I wanted to check where this was at? I can take a look at it and help out with a pull request. I don't have a lot of stats on GitHub as the projects I work on are covered by NDAs so I wanted to get a fun open source project to work on and this looks like it could be a lot of fun.

davidchambers commented 8 years ago

Thanks for your interest, @GixGosu. I haven't been actively developing Tutor, as I've directed my attention towards other open-source projects. If you're interested in working on this, I'm certainly happy to discuss ideas and provide feedback. :)

GixGosu commented 8 years ago

Sounds good! I'll start working on it over the next few days when I'm not working and see what I come up with and reach out to you when I have a good idea of where I can go with it.

davidchambers commented 8 years ago

Excellent!