<?php

include_once 'includes/ProwlPHP.php';
include_once 'includes/prowl.inc.php';
$keys = explode(',', $_GET['key']);
foreach ($keys as $key) {
    $prowl = new Prowl($key, false, $prowl_provider_key);
    $options = array('application' => 'VoiceGrowl', 'event' => 'Test Message', 'description' => 'This is a test message from VoiceGrowl, sent to you by ' . $_SERVER['REMOTE_ADDR'], 'priority' => 0);
    $prowl->push($options, true);
    echo $prowl->getError() . '<br />';
}
Exemple #2
0
<?php

include 'ProwlPHP.php';
$prowl = new Prowl('APIKEY');
$prowl->push(array('application' => 'Application', 'event' => 'Event', 'description' => 'Test message! \\n Sent at ' . date('H:i:s'), 'priority' => 0), true);
var_dump($prowl->getError());
// Optional
var_dump($prowl->getRemaining());
// Optional
var_dump(date('d m Y h:i:s', $prowl->getResetdate()));
// Optional
Exemple #3
0
 mysql_free_result($result);
 // update the occurances of this pattern
 $query = "UPDATE " . $dbgrouptable . " SET amount=amount+1, latesttimestamp = " . time() . " WHERE id=" . $log_groupid;
 $result = mysql_query($query) or die(xml_for_result(FAILURE_SQL_UPDATE_PATTERN_OCCURANCES));
 // check the status of the bugfix version
 $query = "SELECT status FROM " . $dbversiontable . " WHERE bundleidentifier = '" . $bundleidentifier . "' and version = '" . $row[1] . "'";
 $result = mysql_query($query) or die(xml_for_result(FAILURE_SQL_CHECK_BUGFIX_STATUS));
 $numrows = mysql_num_rows($result);
 if ($numrows == 1) {
     $row = mysql_fetch_row($result);
     $fix_status = $row[0];
 }
 if ($notify_amount_group > 1 && $notify_amount_group == $amount && $notify >= NOTIFY_ACTIVATED) {
     // send prowl notification
     if ($push_activated) {
         $prowl->push(array('application' => $appname, 'event' => 'Critical Crash', 'description' => 'Version ' . $version . ' Pattern ' . $crash_offset . ' has a MORE than ' . $notify_amount_group . ' crashes!\\n Sent at ' . date('H:i:s'), 'priority' => 0), true);
     }
     // send boxcar notification
     if ($boxcar_activated) {
         $boxcar = new Boxcar($boxcar_uid, $boxcar_pwd);
         print_r($boxcar->send($appname, 'Version ' . $version . ' Pattern ' . $crash_offset . ' has a MORE than ' . $notify_amount_group . ' crashes!\\n Sent at ' . date('H:i:s')));
     }
     // send email notification
     if ($mail_activated) {
         $subject = $appname . ': Critical Crash';
         if ($crash_url != '') {
             $url = "Link: " . $crash_url . "admin/crashes.php?bundleidentifier=" . $bundleidentifier . "&version=" . $version . "&groupid=" . $log_groupid . "\n\n";
         } else {
             $url = "\n";
         }
         $message = "Version " . $version . " Pattern " . $crash_offset . " has a MORE than " . $notify_amount_group . " crashes!\n" . $url . "Sent at " . date('H:i:s');
Exemple #4
0
 protected function twit($entry, $options)
 {
     if (isset($options['shortener']) && $options['shortener'] && strlen($entry['link']) > $options['maxurllength']) {
         if (!isset($options['shortenerObject'])) {
             $this->debug("create " . $options['shortener'] . " class");
             include_once "r2t/shortener/" . $options['shortener'] . ".php";
             $classname = "r2t_shortener_" . $options['shortener'];
             $options['shortenerObject'] = new $classname();
         }
         $this->debug("shorten " . $entry['link'] . " to ");
         $res = $options['shortenerObject']->shorten($entry['link'], $entry['title']);
         if (is_array($res)) {
             $entry['link'] = $res['url'];
             $entry['title'] = $res['text'];
         } else {
             $entry['link'] = $res;
         }
         $this->debug("    " . $entry['link']);
     }
     // check if something was posted with that link already
     include_once "HTTP/Request.php";
     if (isset($options['twitter']['user'])) {
         $req = new HTTP_Request('http://api.twitter.com/1/statuses/user_timeline.json?screen_name=' . $options['twitter']['user']);
         if ($req->sendRequest()) {
             $tweets = json_decode($req->getResponseBody());
             foreach ($tweets as $tw) {
                 if (isset($tw->text)) {
                     if (strpos($tw->text, $entry['link']) !== false) {
                         $this->debug("  already tweeted link " . $entry['link']);
                         return $options;
                     }
                 } else {
                     continue;
                 }
             }
         }
     }
     $msg = $entry['title'];
     if ($options['addAuthor']) {
         $msg .= " - " . preg_replace("/[^\\s]+@[^\\s]+/", "", $entry['author']);
     }
     $msg .= " " . $entry['link'];
     $msg = preg_replace("/[\\s]{2,}/", " ", $msg);
     if (isset($options['prefix'])) {
         $msg = $options['prefix'] . " " . $msg;
     }
     $msg = trim($msg);
     $this->debug("twit " . $msg);
     /* oauth */
     if ($options['twitter']['token'] && class_exists("OAuth")) {
         $req_url = 'http://twitter.com/oauth/request_token';
         $acc_url = 'http://twitter.com/oauth/access_token';
         $authurl = 'http://twitter.com/oauth/authorize';
         $api_url = 'http://twitter.com/statuses/update.json';
         $conskey = 'DyhAb4DLlFmc5Wn29QvL9g';
         $conssec = 'wgaBiC9YJx38sqBLklUqpkWB1Cq1ztAemp5lkfwQ';
         $oauth = new OAuth($conskey, $conssec, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
         $oauth->debug = 1;
         $oauth->setToken($options['twitter']['token'], $options['twitter']['secret']);
         $api_args = array("status" => $msg, "empty_param" => NULL);
         if (isset($entry['lat'])) {
             $api_args['lat'] = $entry['lat'];
             $api_args['long'] = $entry['long'];
         }
         $oauth->fetch($api_url, $api_args, OAUTH_HTTP_METHOD_POST, array("User-Agent" => "pecl/oauth"));
         /* end oauth */
     } else {
         include_once 'Services/Twitter.php';
         $service = new Services_Twitter($options['twitter']['user'], $options['twitter']['pass']);
         $service->statuses->update($msg);
     }
     $this->debug("prowlApiKey: " . (isset($options['prowlApiKey']) ? $options['prowlApiKey'] : 'unset'));
     if (!empty($options['prowlApiKey'])) {
         include_once 'ProwlPHP/ProwlPHP.php';
         $prowl = new Prowl($options['prowlApiKey']);
         $prowl->push(array('application' => 'rss2twi.php', 'event' => 'New Post', 'description' => $msg, 'priority' => 0), true);
     }
     return $options;
 }
    // Type of cache
    $location = $matches[4];
    // Location of this cache
    $distance = $matches[5];
    // Distance from your home co-ordinates
    $date = $matches[6];
    // Date this log was created
    $log = trim($matches[7]);
    // The log message
    $username = $matches[9];
    // Username of the Geocaching.com User
    $link_log = $matches[8];
    // ID for Link to the log message
    $link_user = $matches[10];
    // ID for Link to user profile
    // Strip through the subject to get the 'action' of this message, such as found,
    // did not find, archived, published etc
    $subject = str_replace("[GEO] Notify: ", "", $structure->headers["subject"]);
    $action = str_replace($title, "", $subject);
    $action = str_replace("(" . $type . ")", "", $action);
    $action = trim(str_replace($username, "", $action));
    // Send a notification out via Prowl
    $prowl = new Prowl();
    $prowl->setApiKey("3d6d41d6a5fb532a51ed40b3fR45tdeb97b6e86d");
    $application = "Geocaching.com";
    $event = "{$username} {$action} {$title} ({$id})";
    $text = $log;
    $url = "http://coord.info/" . $link_log;
    $priority = 0;
    $message = $prowl->push($application, $event, $text, $url, $priority);
}
Exemple #6
0
<?php

include 'ProwlPHP.php';
$prowl = new Prowl('8021a193fb3d6286eb11173a549c7da47468cd1f');
$prowl->push(array('application' => 'rss2twi.php', 'event' => 'New Post', 'description' => 'Test message! \\n Sent at ' . date('H:i:s'), 'priority' => 0), true);
var_dump($prowl->getError());
// Optional
var_dump($prowl->getRemaining());
// Optional
var_dump(date('d m Y h:i:s', $prowl->getResetdate()));
// Optional