For Programmers: Free Programming Magazines  


Home > Archive > PHP Mirrors > February 2007 > cvs: php-master-web /scripts rss_parser update-backend









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: php-master-web /scripts rss_parser update-backend
Hannes Magnusson

2007-02-08, 7:00 pm

bjori Thu Feb 8 22:36:07 2007 UTC

Modified files:
/php-master-web/scripts update-backend rss_parser
Log:
Add RSS feed for php.net/conferences/


http://cvs.php.net/viewvc.cgi/php-m...2&diff_format=u
Index: php-master-web/scripts/update-backend
diff -u php-master-web/scripts/update-backend:1.21 php-master-web/scripts/update-backend:1.22
--- php-master-web/scripts/update-backend:1.21 Wed Nov 1 17:02:06 2006
+++ php-master-web/scripts/update-backend Thu Feb 8 22:36:06 2007
@@ -41,11 +41,19 @@
if (!$dest) { echo "failed to open $root/news.rss for writing"; }
else {
include "rss_parser";
- fwrite($dest, $RSS);
+ fwrite($dest, $RSSNews);
fclose($dest);
}
touch("$root/news.rss", @filemtime("$root/index.php"));

+$dest = fopen("$root/conferences/news.rss", "w");
+if (!$dest) { echo "failed to open $root/conferences/news.rss for writing"; }
+else {
+ fwrite($dest, $RSSConf);
+ fclose($dest);
+}
+touch("$root/conferences/news.rss", @filemtime("$root/conferences/index.php"));
+
// Compress mirrorkit dir in backend to mirrorkit.tgz, and
// then move it to the webspace in case it is properly done
chdir("$root/backend/mirrorkit");
http://cvs.php.net/viewvc.cgi/php-m...6&diff_format=u
Index: php-master-web/scripts/rss_parser
diff -u php-master-web/scripts/rss_parser:1.15 php-master-web/scripts/rss_parser:1.16
--- php-master-web/scripts/rss_parser:1.15 Wed Mar 1 12:41:26 2006
+++ php-master-web/scripts/rss_parser Thu Feb 8 22:36:06 2007
@@ -150,16 +150,16 @@
}

// Generate RSS header text and inject it into $RSS
-function GenerateRSSHeader($headlines, &$RSS) {
+function GenerateRSSHeader($headlines, &$RSS, $aboutLink) {
$RSS .= "<" . "?xml version=\"1.0\" encoding=\"utf-8\"?>\n" .
"<rdf:RDF\n" .
"\txmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n" .
"\txmlns=\"http://purl.org/rss/1.0/\"\n" .
"\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n" .
">\n" .
- "<channel rdf:about=\"http://www.php.net/\">\n" .
+ "<channel rdf:about=\"$aboutLink\">\n" .
"\t<title>PHP: Hypertext Preprocessor</title>\n" .
- "\t<link>http://www.php.net/</link>\n" .
+ "\t<link>$aboutLink</link>\n" .
"\t<description>The PHP scripting language web site</description>\n" .
"\t<items>\n" .
"\t\t<rdf:Seq>\n";
@@ -187,6 +187,7 @@
"</item>\n";
}

+function GenerateRSSFile($root, $aboutLink) {
// Get the PHP.net index page's source code
$homepage = getData("$root/index.php");

@@ -197,7 +198,7 @@
$RSS = '';

// Generate the RSS Header
-GenerateRSSHeader($hlines, $RSS);
+GenerateRSSHeader($hlines, $RSS, $aboutLink);

// Add separator comment
$RSS .= "<!-- RSS-Items -->\n";
@@ -214,5 +215,10 @@
GenerateRSSFooter($RSS);

#DEBUG# echo $RSS;
+return $RSS;
+}
+
+$RSSNews = GenerateRSSFile($root, "http://www.php.net/");
+$RSSConf = GenerateRSSFile("$root/conferences", "http://www.php.net/conferences/");

?>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com