Skip to content

Instantly share code, notes, and snippets.

@064023
064023 / simple location sender.php
Last active August 21, 2016 14:30
simple location sender.php 使用方法:將此 php 放到伺服器,傳送資料時直接傳到這個網址,就會記錄在 data 資料夾;查看資料時,在網址後面加上 group 參數即可查看那一組的資料
<?php
mb_parse_str($_SERVER["QUERY_STRING"], $qs);
$group = array_key_exists('group', $qs) ? preg_replace('/\W/', "", $qs["group"]) : "";
if($group==""){
$postdata = $HTTP_RAW_POST_DATA;
// {"type":"Feature","properties":null,"geometry":{"type":"Point","coordinates":[120.6702662,24.1272791,0]}}
// {"type":"Feature","geometry":{"type":"Point","coordinates":[-100.5,37.35,0]},"properties":{"status":"ok","group_id":"Developer","user_id":"Charles"}}
a = JSON.parse(document.documentElement.innerHTML.replace(/\n/g, "").replace(/^.*lastActiveTimes.*?\{/g, "{").replace(/\}.*/g, "}"));
idlist = {};
myid = document.documentElement.innerHTML.replace(/\n/g, "").replace(/^.*\"USER_ID\":\"/g, "").replace(/\".*$/g, "");
url = "//www.facebook.com/ajax/typeahead/search/facebar/bootstrap/?viewer=" + myid + "&__a=1";
x = new XMLHttpRequest();
x.onreadystatechange=function(){
if (x.readyState==4 && x .status==200){
@064023
064023 / timing4.php
Last active January 10, 2019 10:51
臺中市公車結合去回程的動態到站時刻表
<?php
mb_parse_str($_SERVER["QUERY_STRING"], $qs);
$rid = array_key_exists('rid', $qs) ? $qs["rid"] : "";
$timeformat = array_key_exists('timeformat', $qs) ? $qs["timeformat"] : "0";
$refresh = array_key_exists('refresh', $qs) ? $qs["refresh"] : "0";
$reverse = array_key_exists('reverse', $qs) ? $qs["reverse"] : "0";
$hidecar = array_key_exists('hidecar', $qs) ? $qs["hidecar"] : "0";
$dark = array_key_exists('dark', $qs) ? $qs["dark"] : "0";
$ivrno = array_key_exists('ivrno', $qs) ? $qs["ivrno"] : "";
$stopID = array_key_exists('stopID', $qs) ? $qs["stopID"] : "";