Skip to content

Instantly share code, notes, and snippets.

View slaskis's full-sized avatar
🤓

Robert Sköld slaskis

🤓
View GitHub Profile
$sql = "SELECT word, COUNT(word) AS count FROM log WHERE true ";
if( isset($_GET["c"]) && $_GET["c"] != "" ) $sql .= " AND county = ". $_GET["c"];
if( isset($_GET["g"]) && $_GET["g"] != "" ) $sql .= " AND gender = '". $_GET["g"] ."'";
if( isset($_GET["b"]) && $_GET["b"] != "" ) $sql .= " AND age BETWEEN ". $_GET["b"] ." AND ". $_GET["t"];
$sql .= " GROUP BY word ORDER BY count DESC LIMIT 10";
// Get the selected date and apply the current local time
var currentTime : Date = day.date;
var now : Date = new Date();
currentTime.setHours( now.hours, now.minutes , now.seconds );
var yesterday : Date = new Date( currentTime.time );
yesterday.date -= 1;
query += " published_after:\"" + df.format( DateUtil.toPST( yesterday ) ) + " 16:00\"";
def day_at_ted(local_datetime, local_offset)
pac_time = local_datetime - offset.hours - 8.hours
return pac_time.date
end
def search
search_since = day_at_ted(local_datetime, local_offset) + " 08:00:00"
search_before = day_at_ted(local_datetime, local_offset) + 1.day + " 07:59:00"
end