]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Msn/extlib/phpmsnclass/msnbot.php
Fix mising require_once (now required here because of rearranging)
[quix0rs-gnu-social.git] / plugins / Msn / extlib / phpmsnclass / msnbot.php
1 #!/usr/bin/php
2 <?php
3 global $msn;
4 function ChildSignalFunction($signal)
5 {
6         global $msn;    
7         switch($signal)
8         {
9                 case SIGTRAP:
10                 case SIGTERM:
11                 case SIGHUP:                    
12                         if(is_object($msn))     $msn->End();
13                         return;
14         }
15 }
16
17 // network:
18 //      1: WLM/MSN
19 //      2: LCS
20 //      4: Mobile Phones
21 //     32: Yahoo!
22 function getNetworkName($network)
23 {
24         switch ($network)
25         {
26                 case 1:
27                         return 'WLM/MSN';
28                 case 2:
29                         return 'LCS';
30                 case 4:
31                         return 'Mobile Phones';
32                 case 32:
33                         return 'Yahoo!';
34         }
35         return "Unknown ($network)";
36 }
37
38
39 require_once('config.php');
40 include_once('msn.class.php');
41
42 $msn = new MSN(array(
43                 'user' => 'xxx@hotmail.com',
44                 'password' => 'mypassword',
45                 'alias' => 'myalias',
46                 'psm' => 'psm',
47 //                'PhotoSticker' => 'msntitle.jpg',
48                 'debug'=> true,
49 /*                'Emotions' => array(
50                    'aaa' =>  'emotion.gif'
51                  ),*/
52 ));
53
54 $fp=fopen(MSN_CLASS_LOG_DIR.DIRECTORY_SEPARATOR.'msnbot.pid', 'wt');
55 if($fp)
56 {
57         fputs($fp,posix_getpid());
58         fclose($fp);
59 }
60 declare(ticks = 1);
61 $msn->Run();
62 $msn->log_message("done!");
63 @unlink(dirname($_SERVER['argv'][0]).DIRECTORY_SEPARATOR.'log'.DIRECTORY_SEPARATOR.'msnbot.pid');