<commit_before><?php

use Steam\Steam as Steam;
use Steam\SteamUser as SteamUser;

class HomeController extends BaseController {

  /**
   * Main page display
   * @return View index page
   */
  public function indexAction($uorl = 'most', $list = null)
  {
    /*
      Updates multiple profile with the most efficiently way possible (I hope)

      Use strings because with int, it rounds early and string seems like easy fix.
     */
    if($list == null) {
      $req = $uorl;
    } else {
      $req = array($uorl, $list);
    }

    $userList = UserList::getListType($req);

    $friendsList = array();

    if(Auth::check()) {
      if(Session::has('friendsList') && count(Session::get('friendsList')) != 0) {
        $friendsList = User::whereIn('small_id', Session::get('friendsList'))->get();
      }
    }

    return View::make('main/index', array('userList' => $userList, 'friendsList' => $friendsList));
  }

  public function searchSingleAction() {
    $search = Input::get('search');

    $steam3Id = SteamUser::findSteam3IdUser($search);

    if($steam3Id->type == 'error') {
      return Redirect::home()->with('error', 'Could not find a user based on given information.');
    }

    return Redirect::route('profile', array('steam3Id' => $steam3Id->data));
  }

  public function searchMultipleAction() {
    /*
      1 - Default
      2 - 'status' from console paste
     */
    $searchType = Input::get('search_type');

    $search = Input::get('search');

    if(!isset($searchType) || !isset($search)) {
      return Redirect::home()->with('error', 'Invalid fields.');
    }

    $search = explode("\n", $search);

    if(count($search) > 40) {
      return Redirect::home()->with('error', 'Too many profiles listed in search box.');
    }
  }
}
<commit_msg>wip multi search function<commit_after><?php

use Steam\Steam as Steam;
use Steam\SteamUser as SteamUser;

class HomeController extends BaseController {

  /**
   * Main page display
   * @return View index page
   */
  public function indexAction($uorl = 'most', $list = null)
  {
    /*
      Updates multiple profile with the most efficiently way possible (I hope)

      Use strings because with int, it rounds early and string seems like easy fix.
     */
    if($list == null) {
      $req = $uorl;
    } else {
      $req = array($uorl, $list);
    }

    $userList = UserList::getListType($req);

    $friendsList = array();

    if(Auth::check()) {
      if(Session::has('friendsList') && count(Session::get('friendsList')) != 0) {
        $friendsList = User::whereIn('small_id', Session::get('friendsList'))->get();
      }
    }

    return View::make('main/index', array('userList' => $userList, 'friendsList' => $friendsList));
  }

  public function searchSingleAction() {
    $search = Input::get('search');

    $steam3Id = SteamUser::findSteam3IdUser($search);

    if($steam3Id->type == 'error') {
      return Redirect::home()->with('error', 'Could not find a user based on given information.');
    }

    return Redirect::route('profile', array('steam3Id' => $steam3Id->data));
  }

  public function searchMultipleAction() {
    /*
      1 - Default
      2 - 'status' from console paste
     */
    $searchType = Input::get('search_type');

    $search = Input::get('search');

    if(!isset($searchType) || !isset($search)) {
      return Redirect::home()->with('error', 'Invalid fields.');
    }

    $search = explode("\n", $search);

    if(count($search) > 40) {
      return Redirect::home()->with('error', 'Too many profiles listed in search box.');
    }

    switch($searchType) {
      case 1:
        $this->searchMutlipleDefault($search);
        break;
      case 2:
        break;
    }

    return Redirect::home()->with('error', 'Invalid Search Option');
  }

  private function searchMutlipleDefault($search) {
    if(!is_array($search)) {
      return;
    }

    $validProfile = Array();
    $invalidProfile = Array();

    foreach($search as $potentialProfile) {
      $steam3Id = SteamUser::findSteam3IdUser($potentialProfile);

      if($steam3Id->type == 'error') {
        $invalidProfile[] = $potentialProfile;
      } else {
        $validProfile[] = $steam3Id->data;
      }
    }

    dd($validProfile,
       $invalidProfile);
  }
}

{'fraction_non_alphanumeric': 0.16428404030935084, 'fraction_numerical': 0.006093273962971643, 'mean_word_length': 3.072519083969466, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4635116', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1292, 'n_words': 307}