Example #1
0
 Copyright (C) 2008 Hewlett-Packard Development Company, L.P.

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ***********************************************************/
/**
 * Try out GetFreshmeatRdf
 *
 * @param
 *
 * @return
 *
 * @version "$Id: $"
 *
 * Created on Jun 6, 2008
 */
require_once 'GetFreshMeatRdf.php';
$Rdf = new GetFreshMeatRdf();
$rname = $Rdf->rdf_name;
echo "TG: \$rname is:{$rname}\n";
$Rdf->get_rdf($rname);
Example #2
0
}
if (array_key_exists("o", $options)) {
    $in_file = $options['o'];
} else {
    // default
    $out_file = 'STDOUT';
}
if (array_key_exists("r", $options)) {
    $rdf_file = $options['r'];
} else {
    print "ERROR, -r is a required parameter\n";
    exit(1);
}
// Should still check $in_file and $rdf_file
$INF = new ReadInputFile($in_file);
$gRdf = new GetFreshMeatRdf('');
$gRdf->get_rdf($gRdf->rdf_name);
if ($gRdf->error_code != 0) {
    print "ERROR getting the Freshmeat RDF file\n";
    print "ERROR code was:{$gRdf->error_code}\n";
    print "command output was:";
    print_r($gRdf->error_out);
}
$FRdf = new FreshMeatRdfs($gRdf->rdf_name);
if (!$FRdf->Uncompress($gRdf->rdf_name)) {
    print "Could not uncompress the file {$gRdf->rdf_name}\n";
    print "return code from uncompress:{$FRdf->error_code}\n";
    print "Output from uncompress:{$FRdf->error_out}\n";
}
$FMprojects = $FRdf->XtractProjInfo($FRdf->uncompressed_file);
//print "We got the following from the rdf\n";