Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
bugs fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
kasp3r committed Jan 31, 2014
1 parent d1adc9f commit c7ae29e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ $ php composer.phar install

Library will be installed in vendor/kasp3r/link-preview

In your project include composer autoload file from vendor/.composer/autoload.php
In your project include composer autoload file from vendor/autoload.php

## Usage

```php
$linkPreview = new LinkPreview('http://github.com');
$parsed = $link->getParsed();
$parsed = $linkPreview->getParsed();
foreach ($parsed as $parserName => $link) {
echo $parserName . PHP_EOL . PHP_EOL
echo $parserName . PHP_EOL . PHP_EOL;

echo $link->getUrl() . PHP_EOL;
echo $link->getRealUrl() . PHP_EOL;
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"php": ">=5.3.0",
"guzzle/guzzle": "~3.8"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"autoload": {
"psr-0": {
"LinkPreview": "src/"
Expand Down
3 changes: 2 additions & 1 deletion src/LinkPreview/LinkPreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ public function getParsed()
{
$parsed = array();

if (null === $this->getParsers()) {
$parsers = $this->getParsers();
if (empty($parsers)) {
$this->addDefaultParsers();
}

Expand Down
7 changes: 0 additions & 7 deletions src/LinkPreview/Parser/GeneralParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ public function isValidParser()
*/
public function parseLink()
{
$reader = $this->getReader();
$reader
->setLink($this->getLink())
->readLink();

$this->setLink($reader->getLink());

$link = $this->getLink();

if (!strncmp($link->getContentType(), 'text/', strlen('text/'))) {
Expand Down

0 comments on commit c7ae29e

Please sign in to comment.