Skip to content
A Go library for interacting with the Casper & Snapchat API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
util
.gitignore
.travis.yml
LICENSE
README.md
casper.go
casper_test.go
models.go

README.md

casper

Build Status License GoDoc CasperStatus

casper is a small Go library for interacting with the Casper API and the Snapchat API.

Installation

go get github.com/hako/casper

Usage

You would need to register an account on the Casper API portal in order to use this library. Register an account and comeback to the README.

Don't worry, I won't disappear in 10 seconds :P

Once you've registered an account and installed the library, to get started simply create a Casper{} struct and enter the following:

  • APIKey - your Casper API key.

  • APISecret - your Casper API secret.

  • Username - your Snapchat username.

  • Password - your Snapchat password.

Debug is optional and is set to false by default.

ProjectName is optional and is empty by default.

AuthToken is optional but is required for accessing authenticated endpoints.

Example

package main

import (
	"github.com/hako/casper"
	"fmt"
)

func main() {	
	casperClient := &casper.Casper{
        APIKey:    "yourapikey",
        APISecret: "yourapisecret",
	}
	data, err := casperClient.Login("yoursnapchatusername", "yoursnapchatpassword")
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(data) // JSON
}

Or if you already have an auth token...

package main

import (
	"github.com/hako/casper"
	"fmt"
)

func main() {	
	casperClient := &casper.Casper{
        APIKey:    "yourapikey",
        APISecret: "yourapisecret",
        Username:  "yoursnapchatusername",
        AuthToken: "yoursnapchatauthtoken",
	}
	data, err := casperClient.Updates()
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(data) // JSON
}

See the godoc for more functions for interacting with the API.

Todo

  • More tests.
  • Code cleanup.
    • DRY cleanup.

Security

This library requires you to have a Snapchat account.

By using this library you also agree to the Casper Terms of Use.

Kudos

Author

Wesley Hill - (@hako/@hakobyte)

License

MIT

Legal

Before using this library, take a look at the Casper Terms of Use

Use at your own risk.

You can’t perform that action at this time.