Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezmeta.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezmeta.php 8110 2001-10-31 08:48:33Z jhe $
5 //
6 // Created on: <01-Nov-2000 16:44:39 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 function &fetchURLInfo( $url )
28 {
29 $list = array();
30 $fp = @fopen( $url, "r" );
31 if ( !$fp )
32 $fp = @fopen( $url . "/", "r" );
33 if ( $fp )
34 {
35 $output = fread( $fp, 5000 ); // First 5k should be enough
36 fclose( $fp );
37 if ( preg_match( "#<title>([^<]+)</title>#i", $output, $regs ) )
38 {
39 $title = trim( $regs[1] );
40 $list["title"] = $title;
41 }
42 if ( preg_match( "#<meta[ \t\n]+name[ \t\n]*=[ \t\n]*\"abstract\"[ \t\n]+content[ \t\n]*=[ \t\n]*\"([^\"]+)\"[ \t\n\/]*>#i", $output, $regs ) )
43 {
44 $abstract = trim( $regs[1] );
45 $list["abstract"] = $abstract;
46 }
47 if ( preg_match( "#<meta[ \t\n]+name[ \t\n]*=[ \t\n]*\"description\"[ \t\n]+content[ \t\n]*=[ \t\n]*\"([^\"]+)\"[ \t\n\/]*>#i", $output, $regs ) )
48 {
49 $description = trim( $regs[1] );
50 $list["description"] = $description;
51 }
52 if ( preg_match( "#<meta[ \t\n]+name[ \t\n]*=[ \t\n]*\"keywords\"[ \t\n]+content[ \t\n]*=[ \t\n]*\"([^\"]+)\"[ \t\n\/]*>#i", $output, $regs ) )
53 {
54 $keywords = trim( $regs[1] );
55 $list["keywords"] = $keywords;
56 }
57 return $list;
58 }
59 else
60 {
61 return false;
62 }
63 }
64
65 ?>
$fp
$fp
Definition: export.php:97
fetchURLInfo
& fetchURLInfo( $url)
Definition: ezmeta.php:27
$output
$output
Definition: formpreview.php:81
$url
$url
Definition: messagereviewlist.php:153
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.