Skip to content

Instantly share code, notes, and snippets.

@Downes
Created December 2, 2018 19:22
Show Gist options
  • Save Downes/467aaf0cf15b047267b35fe577dbb923 to your computer and use it in GitHub Desktop.
Save Downes/467aaf0cf15b047267b35fe577dbb923 to your computer and use it in GitHub Desktop.
Create Badge Object in Perl
package gRSShopper::Badgr;
use strict;
use warnings;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use JSON qw(encode_json decode_json);
our $VERSION = "1.00";
sub new {
my($class, $args) = @_;
my $self = bless({}, $class);
while (my ($ax,$ay) = each %$args) {$self->{$ax} = $ay;}
$self->generate_access_token();
return $self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment