Giter Site home page Giter Site logo

casper's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.