Example #1
0
 function archives($site)
 {
     $data['domains'] = get_domains();
     $data['site'] = check_site($site, $data['domains']);
     $data['y'] = '';
     $data['m'] = '';
     $data['d'] = '';
     $data['item_number'] = 0;
     $data['title'] = $data['site'] . ' archives | rrrewind';
     $data['view'] = 'view_archives';
     $this->load->view('template', $data);
 }
Example #2
0
<?php

include 'Services/Twilio.php';
include "config.php";
include "datastore.class.php";
include "functions.php";
$client = new Services_Twilio($accountsid, $authtoken);
$datastore = new DataStore('check_sites');
foreach ($sites as $url => $name) {
    if (!check_site($url)) {
        $datastore->Set($url, 'down', 0);
        $message = "Oops! The site found at {$url} seems to be down!";
        foreach ($people as $number => $person) {
            send_sms($number, $message);
        }
    } else {
        $last = $datastore->Get($url);
        if ($last == 'down') {
            $message = "Yay! The site found at {$url} seems to be back up!";
            foreach ($people as $number => $person) {
                send_sms($number, $message);
            }
        }
        $datastore->Set($url, 'up', 0);
    }
}