Ejemplo n.º 1
0
 /**
  * @dataProvider dataForSafeCurl
  */
 public function testBlockedUrlBySafeCurl($url)
 {
     $graby = new Graby();
     $res = $graby->fetchContent($url);
     $this->assertCount(8, $res);
     $this->assertEquals('', $res['language']);
     $this->assertEquals('', $res['title']);
     $this->assertEquals('[unable to retrieve full-text content]', $res['html']);
     $this->assertEquals('[unable to retrieve full-text content]', $res['summary']);
     $this->assertEquals('', $res['content_type']);
     $this->assertEquals(array(), $res['open_graph']);
     $this->assertEquals(500, $res['status']);
 }
Ejemplo n.º 2
0
 public static function fetchURL($url)
 {
     $graby = new Graby();
     try {
         $r = $graby->fetchContent($url);
         return $r;
     } catch (Exception $e) {
     }
 }