Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dyazincahya authored Dec 27, 2024
1 parent bf85f0b commit 28e63f5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions KBBIModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function _user_agent(){

private function _fetchHtml($word)
{
$userAgents = $this->_user_agent();
$userAgent = $this->_user_agent();
$encodedWord = rawurlencode($word);
$url = "https://kbbi.kemdikbud.go.id/entri/" . $encodedWord;
$ch = curl_init($url);
Expand All @@ -83,13 +83,13 @@ private function _fetchHtml($word)
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Disable SSL host verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable SSL peer verification
curl_setopt($ch, CURLOPT_USERAGENT, 'Localhost');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Forwarded-For: 127.0.0.1']);
// curl_setopt($ch, CURLOPT_USERAGENT, 'Localhost');
// curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Forwarded-For: 127.0.0.1']);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_MAXREDIRS, 3);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgents);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

$response = curl_exec($ch);

Expand All @@ -104,7 +104,7 @@ private function _fetchHtml($word)

private function _request__KBBI_API_Zhirrr($word)
{
$userAgents = $this->_user_agent();
$userAgent = $this->_user_agent();
$encodedWord = rawurlencode($word);
$url = "https://kbbi-api-zhirrr.vercel.app/api/kbbi?text=" . $encodedWord;
$ch = curl_init($url);
Expand All @@ -113,13 +113,13 @@ private function _request__KBBI_API_Zhirrr($word)
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Disable SSL host verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable SSL peer verification
curl_setopt($ch, CURLOPT_USERAGENT, 'Localhost');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Forwarded-For: 127.0.0.1']);
// curl_setopt($ch, CURLOPT_USERAGENT, 'Localhost');
// curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Forwarded-For: 127.0.0.1']);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_MAXREDIRS, 3);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgents);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

$response = curl_exec($ch);

Expand Down

0 comments on commit 28e63f5

Please sign in to comment.