svn: /web/doc/trunk/scripts/ gen_doc_activity_email.php
| From: | Philip Olson | Date: | Wed, 13 Jul 2011 18:25:36 +0000 |
| Subject: | svn: /web/doc/trunk/scripts/ gen_doc_activity_email.php | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-2103@lists.php.net to get a copy of this message | ||
philip Wed, 13 Jul 2011 18:25:36 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=313212
Log:
Updated script to pass in (and use) # of days, meaning, it's not always weekly.
Changed paths:
U web/doc/trunk/scripts/gen_doc_activity_email.php
Modified: web/doc/trunk/scripts/gen_doc_activity_email.php
===================================================================
--- web/doc/trunk/scripts/gen_doc_activity_email.php 2011-07-13 17:31:02 UTC (rev 313211)
+++ web/doc/trunk/scripts/gen_doc_activity_email.php 2011-07-13 18:25:36 UTC (rev 313212)
@@ -24,7 +24,6 @@
losers except for the documentation.
Todo:
- Add SVN lines changed/added/deleted instead of # commits
- - Research the bugs api and ensure it works
- Add other bug activities? So, not only bug->closed?
- Determine if posting statistics is wise (good or bad)
*/
@@ -105,7 +104,7 @@
/**** Weekly closed bugs ****************************************************/
/****************************************************************************/
-$rawbuginfo = file_get_contents('http://bugs.php.net/api.php?type=docs&action=closed&interval=week');
+$rawbuginfo = file_get_contents('http://bugs.php.net/api.php?type=docs&action=closed&interval='
. DAYS_LOOKUP);
$text = '';
if (!empty($rawbuginfo)) {
@@ -139,8 +138,10 @@
$text = '';
if (is_readable($dbfile) && $db = sqlite_open($dbfile, 0666)) {
- $sql = "SELECT who, count(*) as count FROM notes WHERE time > (strftime('%s',
'now')-604800) GROUP BY who ORDER BY count DESC";
+ $seconds = 86400*DAYS_LOOKUP;
+ $sql = "SELECT who, count(*) as count FROM notes WHERE time > (strftime('%s',
'now')-{$seconds}) GROUP BY who ORDER BY count DESC";
+
$res = sqlite_query($db, $sql);
if ($res) {
@@ -169,7 +170,7 @@
$email_text = str_replace('DATES_ACTIVITY', "$time_past to $time_now",
$email_text);
if (!DEBUG_MODE) {
- mail('phpdoc@lists.php.net', 'The weekly PHP documentation activity report',
$email_text, 'From: noreply@php.net', '-fnoreply@php.net');
+ mail('phpdoc@lists.php.net', 'The PHP documentation activity report',
$email_text, 'From: noreply@php.net', '-fnoreply@php.net');
} else {
echo $email_text;
}