Get favorite.

@param \simplehtmldom_1_5\simple_html_dom $each_char

@return string
776902
private function getFavorite($each_char)
    {
        $fav = $each_char->find('.favorites', 0)->plaintext;
        $fav = str_replace(',', '', $fav);

        return trim($fav);
    }
973518
public function getTopMailFromData(int $character_id)
    {
        if (! request()->has('all_linked_characters'))
            return abort(500);

        $character_ids = collect($character_id);

        $user_group = User::find($character_id)->group->users
            ->filter(function ($user) {
                return $user->name !== 'admin' && $user->id !== 1;
            })
            ->pluck('id');

        if (request('all_linked_characters') === 'true')
            $character_ids = $user_group;

        $top = $this->characterTopMailInteractions($character_ids);

        return DataTables::of($top)
            ->editColumn('character_id', function ($row) {

                return $this->getIntelView('character', $row->character_id, $row->from);
            })
            ->editColumn('corporation_id', function ($row) {

                return $this->getIntelView('corporation', $row->character_id, $row->from);
            })
            ->editColumn('alliance_id', function ($row) {

                return $this->getIntelView('alliance', $row->character_id, $row->from)
                    . view('web::character.intel.partials.mailcontentbutton', compact('row'));
            })
            ->rawColumns(['character_id', 'corporation_id', 'alliance_id'])
            ->make(true);
    }
765379
function hot_favorites( $page = 1, $count = 20 )
	{
		$params = array();
		$params['count'] = $count;
		$params['page'] = $page;
		return $this->oauth->get( 'suggestions/favorites/hot', $params);
	}
1015033
private function getFavList($favorite_area, $type)
    {
        $favorite = [];
        $favorite_area = $favorite_area->find('ul[class="favorites-list '.$type.'"]', 0);
        if ($favorite_area) {
            foreach ($favorite_area->find('li') as $each_fav) {
                $temp_fav = [];

                $temp_fav['image'] = $this->getFavImage($each_fav);
                $temp_fav['id'] = $this->getFavId($each_fav);

                if ($type == 'anime' || $type == 'manga') {
                    $temp_fav['title'] = $this->getFavTitle($each_fav);
                    $temp_fav['type'] = $this->getFavType($each_fav);
                    $temp_fav['year'] = $this->getFavYear($each_fav);
                } else {
                    $temp_fav['name'] = $this->getFavTitle($each_fav);

                    if ($type == 'characters') {
                        $temp_fav['media_id'] = $this->getFavMedia($each_fav, 2);
                        $temp_fav['media_title'] = $this->getFavMediaTitle($each_fav);
                        $temp_fav['media_type'] = $this->getFavMedia($each_fav, 1);
                    }
                }

                $favorite[] = $temp_fav;
            }
        }

        return $favorite;
    }
464055
private function getFavorite()
    {
        $right_area = $this->_parser->find('.container-right', 0);
        $favorite_area = $right_area->find('.user-favorites-outer', 0);

        $favorite = [];
        $favorite['anime'] = $this->getFavList($favorite_area, 'anime');
        $favorite['manga'] = $this->getFavList($favorite_area, 'manga');
        $favorite['character'] = $this->getFavList($favorite_area, 'characters');
        $favorite['people'] = $this->getFavList($favorite_area, 'people');

        return $favorite;
    }
689217
public static function fromParser(FavoritesParser $parser): Favorites
    {
        $instance = new self();
        $instance->anime = $parser->getAnime();
        $instance->manga = $parser->getManga();
        $instance->characters = $parser->getCharacters();
        $instance->people = $parser->getPeople();

        return $instance;
    }
1258382
private function getSynopsis($each_anime)
    {
        $synopsis = $each_anime->find('div[class="synopsis js-synopsis"]', 0)->plaintext;
        preg_match('/(No synopsis)/', $synopsis, $temp_synopsis);
        if (!$temp_synopsis) {
            $synopsis = trim(preg_replace("/([\s])+/", ' ', $synopsis));
        } else {
            $synopsis = '';
        }

        return $synopsis;
    }
625068
private function getRecomUser($each_recom)
    {
        $user = $each_recom->find('.users', 0)->plaintext;
        $user = str_replace(['Users', 'User'], '', $user);

        return trim($user);
    }
990562
private function seek($search, $selectors, $current) {
		if (!($search instanceof \DOMElement)) {
			return FALSE;
		}
		list ($tag, $key, $val, $exp, $no_key) = $selectors [$current];
		$pass = TRUE;
		if ($tag === '*' && !$key) {
			exit('tag为*时，key不能为空');
		}
		if ($tag && $tag != $search->tagName && $tag !== '*') {
			$pass = FALSE;
		}
		if ($pass && $key) {
			if ($no_key) {
				if ($search->hasAttribute($key)) {
					$pass = FALSE;
				}
			} else {
				if ($key != "plaintext" && !$search->hasAttribute($key)) {
					$pass = FALSE;
				}
			}
		}
		if ($pass && $key && $val && $val !== '*') {
			if ($key == "plaintext") {
				$nodeKeyValue = $this->text($search);
			} else {
				$nodeKeyValue = $search->getAttribute($key);
			}
			$check = $this->match($exp, $val, $nodeKeyValue);
			if (!$check && strcasecmp($key, 'class') === 0) {
				foreach (explode(' ', $search->getAttribute($key)) as $k) {
					if (!empty ($k)) {
						$check = $this->match($exp, $val, $k);
						if ($check) {
							break;
						}
					}
				}
			}
			if (!$check) {
				$pass = FALSE;
			}
		}
		if ($pass) {
			$current--;
			if ($current < 0) {
				return $search;
			} elseif ($this->seek($this->getParent($search), $selectors, $current)) {
				return $search;
			} else {
				return FALSE;
			}
		} else {
			return FALSE;
		}
	}
1348819
def set_selection_for_char char=nil
      char = _ask_a_char unless char
      #alert "got #{char} "
      return :UNHANDLED if char == :UNHANDLED
      @oldrow = @current_index
      @last_regex = /^#{char}/
      ix = next_regex @last_regex
      #alert "next returned #{ix}"
      return unless ix
      @current_index = ix[0] 
      @search_found_ix = @current_index
      @curpos = ix[1]
      ensure_visible
      return @current_index
    end
151437
function ucfirst ( $string ) {
		$variant = $this->getPreferredVariant();
		if ( ( $variant == 'kk-latn' || $variant == 'kk-tr' ) && $string[0] == 'i' ) {
			$string = 'İ' . substr( $string, 1 );
		} else {
			$string = parent::ucfirst( $string );
		}
		return $string;
	}
308134
public function char(int $char = null): string
    {
        $pos = $this->pos;
        if ( ! is_null($char)) {
            $pos = $char;
        }

        if ( ! isset($this->content[$pos])) {
            return '';
        }

        return $this->content[$pos];
    }
37947
function getBrowser()
    {
        $sys = $this->server['HTTP_USER_AGENT'];
        if (stripos($sys, "Firefox/") > 0)
        {
            preg_match("/Firefox\/([^;)]+)+/i", $sys, $b);
            $exp[0] = "Firefox";
            $exp[1] = $b[1];
        }
        elseif (stripos($sys, "Maxthon") > 0)
        {
            preg_match("/Maxthon\/([\d\.]+)/", $sys, $aoyou);
            $exp[0] = "傲游";
            $exp[1] = $aoyou[1];
        }
        elseif (stripos($sys, "MSIE") > 0)
        {
            preg_match("/MSIE\s+([^;)]+)+/i", $sys, $ie);
            $exp[0] = "IE";
            $exp[1] = $ie[1];
        }
        elseif (stripos($sys, "OPR") > 0)
        {
            preg_match("/OPR\/([\d\.]+)/", $sys, $opera);
            $exp[0] = "Opera";
            $exp[1] = $opera[1];
        }
        elseif (stripos($sys, "Edge") > 0)
        {
            preg_match("/Edge\/([\d\.]+)/", $sys, $Edge);
            $exp[0] = "Edge";
            $exp[1] = $Edge[1];
        }
        elseif (stripos($sys, "Chrome") > 0)
        {
            preg_match("/Chrome\/([\d\.]+)/", $sys, $google);
            $exp[0] = "Chrome";
            $exp[1] = $google[1];
        }
        elseif (stripos($sys, 'rv:') > 0 && stripos($sys, 'Gecko') > 0)
        {
            preg_match("/rv:([\d\.]+)/", $sys, $IE);
            $exp[0] = "IE";
            $exp[1] = $IE[1];
        }
        else
        {
            $exp[0] = "Unkown";
            $exp[1] = "";
        }

        return $exp[0] . '(' . $exp[1] . ')';
    }
975985
private function getAnimeLicensor($each_anime)
    {
        if ($this->_type == 'anime') {
            $licensor = $each_anime->find('div[class="synopsis js-synopsis"] .licensors', 0)->getAttribute('data-licensors');
            $licensor = explode(',', $licensor);

            return array_filter($licensor);
        } else {
            $serialization = $each_anime->find('div[class="synopsis js-synopsis"] .serialization a', 0);

            return $serialization ? $serialization->plaintext : '';
        }
    }
70755
def get_favoritable_value
      if spree_current_user.present?
        @favorite = spree_current_user.favorites.where(favoritable_params).first
      end

      respond_to do |format|
        format.js
      end
    end
852882
private function getImage($each_anime)
    {
        $image = $each_anime->find('td', 1)->find('a img', 0)->getAttribute('data-src');

        return Helper::imageUrlCleaner($image);
    }
332517
private function selector():string{
		$selector = $this->hash(50);
		// Check if selector is unique.
		do{
			$isUnique = Input::$token->selectOneBySelector($selector);
		}while( $isUnique[0] !== null );
		return $selector;
	}