Skip to content

Instantly share code, notes, and snippets.

@troelskn
Created November 28, 2010 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troelskn/719353 to your computer and use it in GitHub Desktop.
Save troelskn/719353 to your computer and use it in GitHub Desktop.
<?php
function notifo_notify($label, $title, $msg, $uri, $user, $pass) {
$opts = array(
'http' => array(
'method' => "POST",
'header' => "Authorization: Basic ".base64_encode($user.":".$pass)."\r\n".
"Content-type: application/x-www-form-urlencoded\r\n",
'content' => http_build_query(array('label' => $label, 'title' => $title, 'msg' => $msg, 'uri' => $uri))
)
);
$context = stream_context_create($opts);
file_get_contents('https://api.notifo.com/v1/send_notification', false, $context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment