function parse()
 {
     require_once PATH_CORE . '/classes/remotefile.class.php';
     $rfObj = new remotePageProperty($this->url);
     $data = array();
     $data['title'] = $this->cleanTitle($rfObj->getPageTitle());
     $page = $rfObj->page_content;
     // to do - grab description from meta tag or story content
     if (preg_match('/<meta name="description"[^>]*content="([^"]+)"/i', $page, $match)) {
         $data['description'] = $match[1];
     } else {
         $temp = $rfObj->getPageParagraphs();
         require_once PATH_CORE . '/classes/utilities.class.php';
         $utilObj = new utilities();
         $temp = $utilObj->shorten($temp, LENGTH_LONG_CAPTION);
         $data['description'] = $temp;
         //$this->log('Caption from gPP: '.$temp);
     }
     $data['images'] = $this->parseImages($rfObj);
     // to do - grab content
     // to do - use my code to grab keywords using semantic library
     return $this->jsonData($data);
 }
예제 #2
0
<?php

// verify email address
setupAppFramework();
if (isset($_GET['test'])) {
    require_once PATH_CORE . '/classes/remotefile.class.php';
    $rfObj = new remotePageProperty($_GET['url']);
    echo $rfObj->getPageTitle();
    $matches = $rfObj->getPageParagraphs();
    print_r($matches);
    require_once PATH_CORE . '/utilities/calais/opencalais.php';
    $oc = new OpenCalais($init['calais']);
    $entities = $oc->getEntities($matches);
    foreach ($entities as $idea) {
        echo $idea . "<br />";
    }
    exit;
    foreach ($entities as $type => $values) {
        echo "<b>" . $type . "</b>";
        echo "<ul>";
        foreach ($values as $entity) {
            echo "<li>" . $entity . "</li>";
        }
        echo "</ul>";
    }
    exit;
}
if (!isset($_GET['e']) and !isset($_GET['a'])) {
    $result = false;
    $app->facebook->redirect(URL_CANVAS . '?p=home&msgType=error&&msg=' . urlencode('There was a problem with your request.'));
} else {