Last active
December 15, 2015 04:39
-
-
Save decause/5203083 to your computer and use it in GitHub Desktop.
Example code for awarding a badge via the tahrir-api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tahrir_api.dbapi import TahrirDatabase | |
db = TahrirDatabase('backend://badges:badgesareawesome@localhost/badges') | |
badge_id = 'fossbox' | |
person_email = '[email protected]' | |
person_id = hash(person_email) | |
issued_on = None | |
db.add_person(person_id, person_email) | |
db.add_assertion(badge_id, person_email, issued_on) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tahrir_api.dbapi import TahrirDatabase | |
db = TahrirDatabase('backend://badges:badgesareawesome@localhost/badges') | |
origin = 'http://foss.rit.edu/badges' | |
issuer_name = 'FOSS@RIT' | |
org = 'http://foss.rit.edu' | |
contact = '[email protected]' | |
issuer_id = db.add_issuer(origin, issuer_name, org, contact) | |
badge_name = 'fossbox' | |
image = 'http://foss.rit.edu/files/fossboxbadge.png' | |
desc = 'Welcome to the FOSSBox. A member is you!' | |
criteria = 'http://foss.rit.edu' | |
db.add_badge(badge_name, image, desc, criteria, issuer_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment