FOSSology  4.4.0
Open Source License Compliance by Open Source Software
GetFreshmeatRdf.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
20  /*
21  * Where will this leave the file? we just pass in some name...so it's
22  * current dir or a full path to where...?
23  */
24 
26 {
27  public $rdf_url = "http://freshmeat.net/backend/fm-projects.rdf.bz2";
28  public $rdf_name;
29  public $error_code;
30  public $error_out;
31  private $Date;
32 
33  public function __construct($name = NULL)
34  {
35  if (empty ($name))
36  {
37  $this->Date = date('Y-n-d');
38  $this->rdf_name = "fm-projects.rdf-$this->Date.bz2";
39  }
40  else
41  {
42  $this->rdf_name = $name;
43  }
44  //echo "__CON: rdf_name is:$this->rdf_name\n";
45  }
46 
53  public function get_rdf($name = NULL)
54  {
55  if (empty ($name))
56  {
57  $name = $this->rfd_name;
58  }
59  $cmd = "wget -q -O $name $this->rdf_url";
60  //echo "will do\n$cmd\n";
61  $toss = exec($cmd, $output, $rtn);
62  $this->error_code = $rtn;
63  $this->error_out = $output;
64  }
65 }
get_rdf($name=NULL)