示例#1
0
if (file_exists("../../inc/common.inc")) {
    require_once "../../inc/common.inc";
} elseif (file_exists("../inc/common.inc")) {
    require_once "../inc/common.inc";
} elseif (file_exists("../../../inc/common.inc")) {
    require_once "../../../inc/common.inc";
}
require_once BASEPATH . '/qcn/inc/utils.inc';
require_once BASEPATH . '/qcn/inc/qcn_auto_detect.inc';
$show_mg = $_GET["show_mag"];
page_top();
if ($show_mg == "y" || $show_mg == "Y") {
    event_info("y");
} else {
    event_info();
}
if ($show_mg == "y" || $show_mg == "Y") {
    show_maps("y");
} else {
    show_maps();
}
echo "<hr> \n<h2>Triggers:</h2>\n";
trigger_info();
show_scatter_tvt();
// Show Estimated v. Observed Travel time  scatter plot
show_scatter_avd();
// Show Amplitude v. Distance scatter plot
show_triggers_db();
// Show the trigger database
show_disclaimer();
示例#2
0
<?php

header('Content-Type: text/html; charset=utf-8');
include_once 'simple_dom_parser/simple_html_dom.php';
require_once 'Unirest.php';
$name = "adele tickets";
$date = "7/5/2016";
$site = "vividseats";
$requested_url = google_search($name, $date, $site);
$page_info = google_html_data($requested_url);
event_info($page_info);
function google_search($event_name, $event_date, $ticket_site)
{
    $url = "https://www.google.com/search?q=" . $event_name . " " . $event_date . " " . $ticket_site;
    $google_page_data = Unirest::GET($url);
    return $google_page_data->raw_body;
}
function google_html_data($page_data)
{
    $html = str_get_html($page_data);
    foreach ($html->find('div[class=g] h3[class=r] a') as $element) {
        $link_check = $element->plaintext;
        if (strpos($link_check, 'Adele') !== false) {
            if (strpos($link_check, '7/5/') !== false) {
                $link_url = $element->href;
                $link_url = explode("&", $link_url);
                $link_url = $link_url[0];
                $link_url = explode("=", $link_url);
                $link_url = $link_url[1];
                $link_url = str_replace("%3F", "?", $link_url);
                $link_url = str_replace("%3D", "=", $link_url);