俺俺ブロガー様のコメント欄感想をPHPで書いてみる

 俺俺ブロガー様のコメント応対の印象はこんな感じ。

PHP:
  1. require_once('Ore_Sama.php');
  2. require_once('Ore_Bible.php');
  3. require_once('OREORE_BROTHERS.php');
  4.  
  5. abstract class Blogger
  6. {
  7.     abstract private $blog;
  8.     private $realName;
  9.     private $handleName;
  10. }
  11.  
  12. class OREORE_Blogger extends Blogger
  13. {
  14.     public $o_ore;
  15.     private $blog;
  16.     private $a_cliche;
  17.    
  18.    
  19.     function __const()
  20.     {
  21.         $this->o_ore = new Ore_Sama();
  22.         $this->blog = $this->o_ore->get_ore_blog();
  23.         $this->add_cliche(OREORE_BROTHERS::get_kakoii_phrase(rand()));
  24.         $this->handle_name = OREORE_BROTHERS::get_kakoii_handle_name();
  25.     }
  26.  
  27.  
  28.     function add_cliche($phrase){
  29.         if(is_array($phrase)) {
  30.             foreach($phrase as $value) {
  31.                 $this->add_cliche($phrase);
  32.             }
  33.         } else if($this->o_ore->standard($phrase)) {
  34.                     $this->cliche[] = $phrase;
  35.                     $result = TRUE;
  36.                 } else {
  37.                     $result = FALSE;
  38.                 }
  39.         return $result;
  40.     }
  41.  
  42.  
  43.     function response($comment)
  44.     {
  45.         if($o_ore->is_difficult($comment)) {
  46.             $result = $a_cliche[rand(0, count($a_cliche) - 1)];
  47.         } else {
  48.             for($i=0; $i <ORE_STYLE; $i++) {
  49.                 $result += OREORE::get_kakoii_comment(rand());
  50.             }
  51.         }
  52.         return $result;
  53.     }
  54. }
  55.  
  56. $o_oreoreBlogger = new OREORE_Blogger();
  57.  
  58. //コメントしてみた場合の反応
  59. print($o_oreoreBlogger->response('コメント');
  60.  
  61. //テンプレ回答を増やす
  62. $o_oreoreBlogger->add_cliche('いかしたフレーズ');


Leave a Reply