//------------------------------------------------------------------------ function file_write($server, $win7) { $message = "Windows 7 サポート期限\n"; $message .= "(2020年1月14日)残り▶\n"; $message .= "【" . $win7["days"] . "("; $message .= $win7["y"] . $win7["m"] . $win7["d"] . $win7["h"] . $win7["i"]; $message .= ")】 \n"; $message .= "VPS連続稼働時間▶\n"; $message .= "【" . $server . "】\n"; $message .= "#Linux #LinuxMint #葛西臨海公園"; return $message; } //----------------------------------------------------------------------------------- $TT = new Twitter_Class(); $win7 = $TT->rekijitsu(2020, 1, 15, 0, 1, 0); $server = $TT->get_uptime(); if ($server == NULL || $win7 == NULL) { echo "ERROR 1"; exit; } else { $message = file_write($server, $win7); $status = $message; //------------------------------------------------------------------------- $twitter = new tmhOauth(array("consumer_key" => $consumer_key, "consumer_secret" => $consumer_secret, "token" => $token, "secret" => $secret, "curl_ssl_verifypeer" => false)); $c = 0; $media = count($image); $result_media_id = $TT->upload_image($twitter, $image); // echo count($result_media_id); while (count($result_media_id) != $media && $c < 10) { $result_media_id = $TT->upload_image($twitter, $image);
//------------------------------------------------------------------------ function file_write($server, $vista) { $message = "Windows Vista サポート期限\n"; $message .= "(2017年4月11日)残り▶\n"; $message .= "【" . $vista["days"] . "("; $message .= $vista["m"] . $vista["d"] . $vista["h"] . $vista["i"]; $message .= ")】 \n"; $message .= "VPS連続稼働時間▶\n"; $message .= "【" . $server . "】\n"; $message .= "#Linux #LinuxMint #葛西臨海公園 "; return $message; } //----------------------------------------------------------------------------------- $TT = new Twitter_Class(); $vista = $TT->rekijitsu(2017, 4, 12, 0, 1, 0); $server = $TT->get_uptime(); if ($server == NULL || $vista == NULL) { echo "ERROR 1"; exit; } else { $message = file_write($server, $vista); $status = $message; //------------------------------------------------------------------------- $twitter = new tmhOauth(array("consumer_key" => $consumer_key, "consumer_secret" => $consumer_secret, "token" => $token, "secret" => $secret, "curl_ssl_verifypeer" => false)); $c = 0; $media = count($image); $result_media_id = $TT->upload_image($twitter, $image); // echo count($result_media_id); while (count($result_media_id) != $media && $c < 10) { $result_media_id = $TT->upload_image($twitter, $image);
/* author:Kouji Sugibayashi */ require_once '/home/kouji/public_html/html/AutoTweet/TanpopoWeather.php'; $TT = new Twitter_Class(); function youbi_japan() { //日本語の曜日配列 $weekjp = array('日', '月', '火', '水', '木', '金', '土'); //現在の曜日番号(日:0 月:1 火:2 水:3 木:4 金:5 土:6)を取得 $weekno = date('w'); //日本語曜日を出力 return $weekjp[$weekno]; } $win10 = $TT->rekijitsu(2025, 10, 15, 0, 1, 0); $win8 = $TT->rekijitsu(2023, 1, 11, 0, 1, 0); $win7 = $TT->rekijitsu(2020, 1, 15, 0, 1, 0); $vista = $TT->rekijitsu(2017, 4, 12, 0, 1, 0); if ($vista == NULL || $win7 == NULL) { echo "ERROR"; exit; } else { $img = ImageCreateFromJPEG("/home/kouji/public_html/html/AutoTweet/image/337.jpg"); $title_txt = mb_convert_encoding("Microsoft Windows サポート期間\n" . date("Y年m月d日〔" . youbi_japan() . "〕 H時i分 現在"), 'UTF-8', 'auto'); $Win10_txt = mb_convert_encoding("Windows 10 サポート 残り日数", "UTF-8", "auto"); $Win10_txt2 = mb_convert_encoding("2025年10月14日まで、\n【" . $win10["days"] . "】\n(" . $win10["y"] . $win10["m"] . $win10["d"] . $win10["h"] . $win10["i"] . ")", 'UTF-8', 'auto'); $Win8_txt = mb_convert_encoding("Windows 8.1 サポート 残り日数", "UTF-8", "auto"); $Win8_txt2 = mb_convert_encoding("2023年01月10日まで、\n【" . $win8["days"] . "】\n(" . $win8["y"] . $win8["m"] . $win8["d"] . $win8["h"] . $win8["i"] . ")", 'UTF-8', 'auto'); $Win7_txt = mb_convert_encoding("Windows 7 サポート 残り日数", "UTF-8", "auto"); $Win7_txt2 = mb_convert_encoding("2020年01月14日まで、\n【" . $win7["days"] . "】\n(" . $win7["y"] . $win7["m"] . $win7["d"] . $win7["h"] . $win7["i"] . ")", 'UTF-8', 'auto');