Skip to content

Instantly share code, notes, and snippets.

View kenichimiki's full-sized avatar

MIKI-IE kenichimiki

View GitHub Profile
@kenichimiki
kenichimiki / home-api-history-of-nature-remo.php
Created July 6, 2019 20:48
Store the senser histories of Nature Remo to SQL DB( Room Temperature, Humidity and Illuminance)
<?php
/*************************************************************************
* home-api (History of Nature Remo Senser)
* Home Tools for private. Using IFTTT and Google Home etc
*
* PHP 5 or later
*
* @category Home IoT
* @author Miki
* @url https://www.miki-ie.com/
@kenichimiki
kenichimiki / home-api-check-weather.php
Created July 8, 2019 10:44
Using Yahoo!JAPAN weather API for check condition
<?php
/*************************************************************************
* home-api (Weather)
* Home Tools for private. Using IFTTT and Google Home etc
*
* PHP 5 or later
*
* @category Home IoT
* @author Miki
* @url https://www.miki-ie.com/
import urllib.request
#params for IFTTT
ifttt_api_key = '/with/key/@アクセスキー@'
url_base = 'https://maker.ifttt.com/trigger/'
#EVENT name for IFTTT
ifttt_event = 'test'
url = url_base + ifttt_event + ifttt_api_key
params = {'value1': 123,'value2': 123,'value3': 123,}
@kenichimiki
kenichimiki / sendgrid-api.php
Created July 27, 2019 00:18
PHP script for Inbound Email Parse Webhook of SendGrid
<?php
/*************************************************************************
* sendgrid-api (MAIN)
* Home Tools for private. Using IFTTT and Google Home etc
*
* PHP 5 or later
*
* @category Home IoT
* @author Miki
* @url https://www.miki-ie.com/
@kenichimiki
kenichimiki / home-api-tweet-janken-result.php
Created August 9, 2019 03:15
Post new tweet using TwitterOAuth
<?php
require "twitteroauth/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
define("TARGET_TWEET",0);
##TARGET_TWEET 0 is newest record
$host_name = '127.0.0.1:3307';
$user_name = '@DB_User@';
$password = '@DB_Pass@';
$database_name ='@DB_Name@';
$table_name = '@DB_Table@';
@kenichimiki
kenichimiki / control-regza-tv.py
Created August 24, 2019 02:07
Control Toshiba Regza TV via python using web I/F
import requests
from requests.auth import HTTPDigestAuth
TV_IP = "xxx.xxx.xxx.xxx"
TV_USER = "user"
TV_PASS = "pass"
TV_VOLUME_DOWN = "40BF1E"
TV_BOTTON_8 = "40BF08"
def execjanken(key):
@kenichimiki
kenichimiki / Python-Darknet-DNN-Sample.py
Created September 8, 2019 11:47
Implement to Python for Darknet/YOLO model using DNN module. Sample code
#!/usr/bin/env python
# coding: utf-8
target_model = "yolov3-tiny-janken_final.weights"
target_config = "yolov3-tiny-janken.cfg"
import cv2 as cv
import numpy as np
MODEL = "./janken_cfg/" + target_model
@kenichimiki
kenichimiki / Sample_Using_jankenApi.py
Created September 20, 2019 07:48
Sample of how to call the Mezamashi Park jankenApi from Python3 script.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib.request
import json
url = 'https://janken.miki-ie.com/jankenApi.php'
headers = {
'Authorization': 'Bearer @@API_KEY@@',
@kenichimiki
kenichimiki / Sample_Using_jankenApi.php
Created September 20, 2019 07:48
Sample of how to call the Mezamashi Park jankenApi from PHP script.
function updatePredict($date, $times, $predict,$api_key){
$post_data = [
"mod" => "updatePredict",
"date" => $date,
"times" => $times,
"predict" => $predict
];
//curl実行
$curl = curl_init("https://janken.miki-ie.com/jankenApi.php");
@kenichimiki
kenichimiki / PredictJanken.ipynb
Created April 7, 2020 06:53
めざましじゃんけん 時系列予測 サンプルスクリプト
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.