I'm attempting to make a Challenge Board rails app, which is essentially a search engine for Open Badges.
I need to aggregate all of the Open Badges that are available to be earned.
I've been looking through the Open Badge code on Github, and I found this:
Badge.finders = {
email: function (value, callback) {
var query = "SELECT * FROM `badge` WHERE `user_id` = (SELECT `id` FROM `user` WHERE `email` = ?)";
mysql.client.query(query, [value], callback);
}
};
(located at https://github.com/mozilla/openbadges/blob/development/models/badge.js)
So, can I just play around with that query to get what I want? Maybe this is the wrong way to go about things. Does anyone know of a way to get all of the available Open Badges? I've looked through the Displayer API, but it looks to be just for displaying a particular user's public badges.
I've considered writing a bot that spams the email-to-Open-Badge converter, and then takes each valid email (one attached to a real user) and stores it's ID code. Then I could cycle through those IDs to JSON query like this: http://beta.openbadges.org/displayer/[id]/groups.json and then keep a hash of all the different badges. However, I don't want to make a bot. Additionally, that system wouldn't add badges that are available, but no one has earned yet.
Anyone know of a good solution for this?