Skip to content

Commit

Permalink
Provide a public-facing parse function
Browse files Browse the repository at this point in the history
This should allow devs using the library to retrieve HTML pages through other methods, if they wish, and parse them using the OpenGraph library.
  • Loading branch information
AramZS authored Jul 12, 2016
1 parent d95a5f4 commit cf70323
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions OpenGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ static public function fetch($URI) {
return false;
}
}

static public function parse($HTML){
if ( empty( $HTML ) ){
return false;
}
$response = mb_convert_encoding($HTML, 'HTML-ENTITIES', 'UTF-8');
return self::_parse($response);
}

/**
* Parses HTML and extracts Open Graph data, this assumes
Expand Down

0 comments on commit cf70323

Please sign in to comment.