This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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\""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |