/**
  * @param $param
  * @return int
  */
 public function actionInstagram($param, $limit = null)
 {
     //resume before
     $resume = $this->resume();
     $current = 0;
     if (!empty($resume)) {
         if ($this->crawl($resume, $limit, $current)) {
             return Controller::EXIT_CODE_NORMAL;
         }
     }
     $tags = $this->getTags($param);
     while (!empty($tags)) {
         $name = array_shift($tags);
         FileHelper::writeText(Url::to(static::INSTAGRAM_TAGS), $tags, true);
         echo $name . "\n";
         $data = Instagram::getPostsByTag($name);
         if (!isset($data)) {
             continue;
         }
         Instagram::savePosts($data);
         echo $current . "\n";
         if (isset($data->pagination) && isset($data->pagination->next_url)) {
             if ($this->crawl($data->pagination->next_url, $limit, $current)) {
                 return Controller::EXIT_CODE_NORMAL;
             }
         } else {
             if (isset($limit) && $limit < ++$current) {
                 echo "limit is over tag\n";
                 return 1;
             }
         }
     }
     return Controller::EXIT_CODE_NORMAL;
 }