Project

codebadges

0.0
No commit activity in last 3 years
No release in over 3 years
Get user user achievements and course lists from Codecademy
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 2.7
 Project Readme

CodeBadges Gem VersionBuild Status

Codecademy is a great place to learn coding! Unfortunately, Codecademy's website doesn't provide an API.

So we made the CodeBadges gem to scrape user achievements from Codecademy!

Note that we respect Codecademy's robots.txt

Installation

Install it with the following command:

$ gem install codebadges

Or else put it in your Gemfile as:

gem codebadges

and run bundle install.

Usage

CLI: Finding user badges

Run it from the command line. For example, to get the achievements of user chenlizhan:

$ codebadges chenlizhan

You will be required to enter username/password credentials to access codecademy user achievements. This gem never stores your credentials nor uses them for any other purpose.

Code: Finding user badges

Use it from your Ruby code:

require 'codebadges'

cademy_badges = CodeBadges::GetCodecademyBadges.new('my_username', 'my_password')
badges = cademy_badges.call('chenlizhan')

Code: Finding full course list

Use it from your Ruby code:

courses = CodeBadges::GetCodecademyCourses.call

Testing

First, setup environment variables called CC_USERNAME and CC_PASSWORD with your Codecademy username and password.

Then:

rake spec

Alternatively:

CC_USERNAME=myusername CC_PASSWORD=mypassword rake spec