Git Product home page Git Product logo

cm's Introduction

Simple github api front end

The project is implemented in Go programming language, we use the opensource
"github.com/spf13/cobra" as the cli/console application framework 

How to build

install Go, https://golang.org/doc/install
make sure $GOPATH has been configured
    cd $GOPATH
    go get github.com/wy3148/cm
    cd $GOPATH/src/github.com/wy3148/cm
    go build

How to use

./cm help
./cm client --api_key your_api_key --client_id your_client_id
./cm list create --api_key your_api_key --client_id your_client_id --json_file example.json

example.json is a json-formatted file
{
"Title": "Website Subscribersi Testing",
"UnsubscribePage": "http://www.example.com/unsubscribed.html",
"UnsubscribeSetting": "AllClientLists",
"ConfirmedOptIn": false,
"ConfirmationSuccessPage": "http://www.example.com/joined.html"
}

API url

the default API url: https://api.createsend.com/api/v3.1
run 'export cm_url' on linux/mac or 'set cm_url' on windows to configure a different API url

Testing result

./cm client --api_key your_api_key --client_id your_client_id using default url: https://api.createsend.com/api/v3.1 2018/02/17 22:23:41 response code: 200 2018/02/17 22:23:41 body response:

 {
 "ApiKey": "28160ca6ab63eda45a74d3317869b500b364b85fc31ead15",
 "BasicDetails": {
  "ClientID": "e7a8cbe95cd62de2afda7189612a5895",
  "CompanyName": "NETFON",
  "ContactName": "",
  "EmailAddress": "",
  "Country": "Australia",
  "TimeZone": "(GMT+10:00) Canberra, Melbourne, Sydney"
 },
 "BillingDetails": {
  "CanPurchaseCredits": false,
  "Credits": 0,
  "BaseDeliveryRate": 7.0,
  "BaseRatePerRecipient": 1.4000,
  "BaseDesignSpamTestRate": 7.0,
  "MarkupOnDelivery": 0.0,
  "MarkupPerRecipient": 0.0,
  "MarkupOnDesignSpamTest": 0.0,
  "Currency": "AUD",
  "ClientPays": false
 }
}

./cm list create --api_key your_api_key --client_id your_client_id --json_file example.json using default url: https://api.createsend.com/api/v3.1

2018/02/17 22:21:50 will create a new list: {
    "Title": "Website Subscribersi Testing",
    "UnsubscribePage": "http://www.example.com/unsubscribed.html",
    "UnsubscribeSetting": "AllClientLists",
    "ConfirmedOptIn": false,
    "ConfirmationSuccessPage": "http://www.example.com/joined.html"
}

2018/02/17 22:21:51 response code: 201
2018/02/17 22:21:51 body response:
 "aaf13cd89855e2c164350cbe4cd4dba7"

cm's People

Watchers

 avatar  avatar

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.