Git Product home page Git Product logo

cpushover's Introduction

cpushover

An API and command-line interface for sending messages via Pushover, written in ANSI C

As per now, only the API is functional, and the CLI itself is yet to be written. If you want to use cpushover in your own application, this is what you do:

  • Include cpushover.h into your project, link libcurl. The linker flags needed can be found by running "curl-config --libs".
  • Initialize libcurl through curl_global_init with a sensible set of flags, e.g. curl_global_init(CURL_GLOBAL_DEFAULT);
  • Initialize the API by providing your pushover handle, cpsh_init("yourhandlehere");
  • Declare the message struct using the typedef cpsh_message, e.g. cpsh_message msg; Remember to set all unused fields to 0, e.g. by memset(&msg, 0, sizeof(msg)); Set the parameters you want. You have to set msg.user and msg.message, the recipient's pushover token and the message body respectively, but all the other parameters can be zero/NULL.
  • Send the message with cpsh_send(&msg); A zero return value indicates success. Anything else indicates an error, and can be decoded using the error constants in the header file.
  • Run curl_global_cleanup() when you're done.

This project uses Dave Gamble's cJSON library, http://sourceforge.net/projects/cjson/.

cpushover's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cpushover's Issues

Example code?

Thanks for this code, I am looking at it and trying to understand how I can use it in my own project.

Would it be possible to get a working example.c (once the TOKEN and USER has been entered) that uses all current API functions?

It would save me much time.

Many thanks in advance

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.