-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from widibaka/development
Development
- Loading branch information
Showing
35 changed files
with
686 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
class Getepisode extends CI_Controller | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); // Aturan saklek CI, ini harus ada | ||
|
||
$this->load->model('Client_model'); | ||
|
||
//include the configuration | ||
include( 'config/config.php' ); | ||
//initiate database with custom config | ||
$this->load->database($config); | ||
|
||
|
||
} | ||
public function index($anime_child_id){ | ||
$data = $this->Client_model->getEpisodesByChildId($anime_child_id)[0]; | ||
$data['converted_links'] = explode("@", $data['links']); | ||
echo json_encode($data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
class Getlinkmetadata extends CI_Controller | ||
{ | ||
public function index($URL){ | ||
$URL = base64_decode($URL); | ||
// echo $URL; | ||
// die(); | ||
$html = file_get_contents( $URL ); | ||
libxml_use_internal_errors(true); // Yeah if you are so worried about using @ with warnings | ||
$doc = new DomDocument(); | ||
$doc->loadHTML($html); | ||
$xpath = new DOMXPath($doc); | ||
$query = '//*/meta[starts-with(@property, \'og:\')]'; | ||
$metas = $xpath->query($query); | ||
$rmetas = array(); | ||
foreach ($metas as $meta) { | ||
$property = str_replace(":", "_", $meta->getAttribute('property')); // hilangkan "og:" biar objek json nya bisa diakses | ||
$content = $meta->getAttribute('content'); | ||
$rmetas[$property] = $content; | ||
} | ||
|
||
// get web page title | ||
$rmetas['page_title'] = $this->getTitle( $URL ); | ||
// get meta tags | ||
$meta_tags = get_meta_tags( $URL ); | ||
$rmetas['meta_tags'] = $meta_tags; | ||
|
||
$json = json_encode($rmetas); | ||
echo $json; | ||
|
||
// var_dump($meta_tags); | ||
// Output: | ||
// Title: PHP 5 Tutorial | ||
} | ||
// function to get webpage title | ||
public function getTitle($url) { | ||
$page = file_get_contents($url); | ||
$title = preg_match('/<title[^>]*>(.*?)<\/title>/ims', $page, $match) ? $match[1] : null; | ||
return $title; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.