FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
GetFreshmeatRdf.php
1 <?php
2 
3 
4 /***********************************************************
5  Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License
9  version 2 as published by the Free Software Foundation.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License along
17  with this program; if not, write to the Free Software Foundation, Inc.,
18  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  ***********************************************************/
20 
33  /*
34  * Where will this leave the file? we just pass in some name...so it's
35  * current dir or a full path to where...?
36  */
37 
39 {
40  public $rdf_url = "http://freshmeat.net/backend/fm-projects.rdf.bz2";
41  public $rdf_name;
42  public $error_code;
43  public $error_out;
44  private $Date;
45 
46  public function __construct($name = NULL)
47  {
48  if (empty ($name))
49  {
50  $this->Date = date('Y-n-d');
51  $this->rdf_name = "fm-projects.rdf-$this->Date.bz2";
52  }
53  else
54  {
55  $this->rdf_name = $name;
56  }
57  //echo "__CON: rdf_name is:$this->rdf_name\n";
58  }
59 
66  public function get_rdf($name = NULL)
67  {
68  if (empty ($name))
69  {
70  $name = $this->rfd_name;
71  }
72  $cmd = "wget -q -O $name $this->rdf_url";
73  //echo "will do\n$cmd\n";
74  $toss = exec($cmd, $output, $rtn);
75  $this->error_code = $rtn;
76  $this->error_out = $output;
77  }
78 }
79 ?>
get_rdf($name=NULL)