Skip to main content

USA:From being Leader to Dealer

USA:From being Leader to Dealer American people have stopped to have leadership. I felt something sad, but it’s okay. USA country turned from leader to dealer. Some American wanted to make America great again.(MAGA) The world NEVER makes America great again.(NMAGA)

The PHP language

2020/6/14.  The PHP language


Recently, I am learning PHP language.
PHP language is server-side language, and it is useful for web watching.

I wrote below code for web-watching to take the Mensa Japan exam.
(I am already Mensa member.)(And I don’t know this code will work well.)
Below code notifies with LINE app, so if you want to use it, you have to get permission from LINE development.
And you need to set some settings on your smartphone.

This is only test code, and if you want to use this code, you need some knowledge about Information technology.
And if you can use Linux crontab, this code runs every time.

I know you don’t need to take Mensa Japan exam.
This is just sample for getting a ticket which is difficult to get online.

First, I tried to use e-mail, but the e-mail’s security setting is too difficult.
So, I changed to use LINE app.
I took few weeks for writing below code, programming is so hard… Of course it is fun.

I started learning programming 2.5 years ago…
It was long time, but I got reached very far place from it…

(Code) *** is your LINE token.

<?php

$url = 'https://mensa.jp/exam/'; 
$filename = '/home/pi/Desktop/Mensa-exam-judge.txt'; 

$input = file_get_contents($url);
$prv = file_get_contents($filename);

$match1 = mb_strstr($input, '関東地方</h3>');
$match1 = str_replace(array(" ", " "), "", $match1);
$match1_1 = mb_strstr($match1, '</p>', true);
//var_dump($match1_1);

$match2 = mb_strstr($prv, '関東地方</h3> ');
$match2 = str_replace(array(" ", " "), "", $match2);
$match2_1 = mb_strstr($match2, '</p>', true);
//var_dump($match2_1);

if($match1_1 != $match2_1){

echo "NO";

define('LINE_API_URL'  ,'https://notify-api.line.me/api/notify');
define('LINE_API_TOKEN’,’***’);

function post_message($message){

    $data = http_build_query( [ 'message' => $message ], '', '&');

    $options = [
        'http'=> [
            'method'=>'POST',
            'header'=>'Authorization: Bearer ' . LINE_API_TOKEN . "\r\n"
                    . "Content-Type: application/x-www-form-urlencoded\r\n"
                    . 'Content-Length: ' . strlen($data)  . "\r\n" ,
            'content' => $data,
            ]
        ];

    $context = stream_context_create($options);
    $resultJson = file_get_contents(LINE_API_URL, false, $context);
    $resultArray = json_decode($resultJson, true);
    if($resultArray['status'] != 200)  {
        return false;
    }
    return true;
}
post_message("Mensa Exam!+ ${url}");

$fp = fopen($filename, 'w');
fwrite($fp, $input);
fclose($fp);


}else {
    
echo "YES";

}
?>

Popular posts from this blog

How to find Cheat GPT in Business

  How to find Cheat GPT in Business Background ChatGPT is very good tool for Business writing. But ChatGPT is forbidden now when the Business treats secret information. I know it is right. Cheat GPT Cheat GPT is to use ChatGPT in the Business. How to find Cheat GPT? I found my leader’s Cheat GPT accidentally. The leader used ChatGPT in his home, so that there was no way to know Cheat GPT. I found it by miss font. The miss font was classic Chinese character(旧漢字). In Japan, no one use classic Chinese character from 1949. I use systematic grammar proofing application and it showed me there was classic Chinese Character. Abstracted way If there are many language characters, such as Chinese or Japanese, systematic font proofing application may be effective way to find Cheat GPT. ChatGPT and Hallucination is one set, and it is the way.

Own view to World and I

  Own view to World and I I thought about feeling method about world and I. The principle questions are “What is the World?”, “Who am I?”. There are several feelings about these questions’ answers. View to World and I I am [ positive ] I am [ normal ] I am [ negative ] World is [ positive ] Normal A Mismatch B1 Mismatch C World is [ normal ] Positive thinking Normal B Negative thinking World is [ negative ] Mismatch A Mismatch B2 Normal C I categorized the answers in above matrix. If “World is [negative]” and “I am [normal]” is the answer, Mismatch B2 is my position. Then if we want to change something, we should change view to the world or I.