Gem Finder

MVP
90 Tauren Druid
10125
Hi, guys,

I wanted to learn a new framework, and to do so in anger (http://37signals.com/svn/posts/2582-how-do-i-learn-to-program) I decided to work on a project I'd been thinking about for a while, and I thought I'd share it here.

It's a web-based tool for finding gems based on criteria (color, bonuses, etc.), and it's running at http://gems.brandontilley.com/. You can find the source at https://github.com/BinaryMuse/wow-gems.

Let me know what you think!

________________________________________________
MVP, Web and API
Libraries for the Community Platform API: http://us.battle.net/wow/en/forum/topic/2369882588
Libraries for the Community Platform API: http://us.battle.net/d3/en/forum/topic/6307731317
Reply Quote
100 Tauren Shaman
13385
Looks very interesting, glad to see Coffeescript and AngularJS getting some attention around here.

I was initially curious as to what data store you were using but it's surprising that there is none.
Edited by Lunarhawk on 11/5/2012 8:20 AM PST
Reply Quote
90 Night Elf Monk
11335
What a great idea for an App! I can see myself pointing guildies to find out what kinds of gems they wanted, or being able to quickly tell someone there really are no +Agi / +Exp gems in game. I'm curious, how were you able to form all the data? Hopefully not something you've built by hand :)
Reply Quote
90 Human Paladin
14880
11/05/2012 08:17 AMPosted by Vester
I'm curious, how were you able to form all the data?


I didn't look at the source, but some it seems it's a JSON file that he created:
http://gems.brandontilley.com/data/gems.json

Not sure how he went about the creation. Anyways... which framework were you trying to learn? Not really clear since there's many different frameworks at play in this.
Reply Quote
MVP
90 Tauren Druid
10125
11/05/2012 08:16 AMPosted by Lunarhawk
I was initially curious as to what data store you were using but it's surprising that there is none.


Originally I was going to have some kind of backend, but the data set is small enough that it's fine to load and filter in memory.

11/05/2012 08:17 AMPosted by Vester
I'm curious, how were you able to form all the data? Hopefully not something you've built by hand :)


After I got a list of item IDs for gems that came out in MoP, I hit the item API for each one downloading a cache file of the data. Another script iterates over each of the cache files and massages the data info a format the filter uses.

Both the scripts are in the `scripts` folder.

11/05/2012 10:09 AMPosted by Laurabelle
Anyways... which framework were you trying to learn? Not really clear since there's many different frameworks at play in this.


AngularJS in this instance. I'm already a huge Node.js and CoffeeScript fan. :) After using Angular for this and a few pet projects, I'm totally sold.

________________________________________________
MVP, Web and API
WoW Libraries for the Community Platform API: http://us.battle.net/wow/en/forum/topic/2369882588
D3 Libraries for the Community Platform API: http://us.battle.net/d3/en/forum/topic/6307731317
Edited by Cyaga on 11/5/2012 9:09 PM PST
Reply Quote
90 Human Paladin
14880
I have an `item_cache` table with a primary key on `item_id` and a composite index on (`itemLevel`,`itemClass`,`itemSubClass`,`isAuctionable`).

I find it useful, because I constantly need to build subsets from the `item_cache`. For example, I am often interested in all rare quality cuts or meta gems introduced by MoP. One way to pull those id's is with a query like this against my cache:

select * from `item_cache`
where
((`item_cache`.`isAuctionable` = 1) -- can be auctioned
and (`item_cache`.`itemLevel` = 90) -- usable by level 90 only
and (`item_cache`.`itemClass` = 3) -- 3 = Gem
and (`item_cache`.`itemSubClass` <> 10) -- no Cogwheels
);
Reply Quote
MVP
90 Tauren Druid
10125
11/06/2012 06:27 AMPosted by Laurabelle
I find it useful, because I constantly need to build subsets from the `item_cache`.


Part of me wants to build something using a larger dataset than the little gems site I listed to mess around with this kind of thing. I toyed with several ideas on how to query against the gems, but I ended up with a very naive approach that just iterates over the checked boxes and runs a few loop comprehensions--this only works, again, because the dataset is only a few hundred items.

# Called on every tick or untick of a checkbox in the filter.
# Starts from all gems and applies every enabled filter.
refilter: =>
newGems = @allGems
for category, obj of @filter
for type, value of obj
newGems = @applyScope(newGems, category, type) if value == true
@gems = newGems


I'm particularly interested in what one could do with a document-oriented data store like MongoDB or CouchDB. Couch is especially interesting as you can query from client-side JavaScript (or any HTTP client for that matter), but MongoDB gives you the ability to do ad-hoc queries on loosely-structured documents, so I'm not sure which would be more fun. :)
________________________________________________
MVP, Web and API
WoW Libraries for the Community Platform API: http://us.battle.net/wow/en/forum/topic/2369882588
D3 Libraries for the Community Platform API: http://us.battle.net/d3/en/forum/topic/6307731317
Reply Quote
100 Tauren Shaman
13385
Redis may be of interest to you, it has data structures that mimic basic programming constructs very closely (hashes, sets, lists, sorted sets, in addition to basic key/value pairs).

In this case set union/set diff/set intersection seems to be what you want.

http://redis.io/
Reply Quote
MVP
90 Tauren Druid
10125
11/07/2012 08:47 AMPosted by Lunarhawk
Redis may be of interest to you, it has data structures that mimic basic programming constructs very closely


Oh maaaan, I love me some Redis. We use it extensively where I work, and I use it often in my personal projects (I love the simple pub/sub capabilities). It would be a neat fit for the Gem Finder project if it had more data, since it's easy to massage the data into sets for each category. The only issue I have with it for larger projects is, since all the data has to fit in RAM, I'd have to run a separate server for it or else pay for third-party hosting (there's not a lot of RAM left on my main web server...)
________________________________________________
MVP, Web and API
WoW Libraries for the Community Platform API: http://us.battle.net/wow/en/forum/topic/2369882588
D3 Libraries for the Community Platform API: http://us.battle.net/d3/en/forum/topic/6307731317
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]