cvs: pearbot /modules pearbugs.php pearcvscommits.php
[email protected] ("Amir Mohammad Saied") Mon, 05 May 2008 07:00:25 -0000
| Newsgroups | php.pear.cvs |
|---|---|
| Message-ID | <cvsamir1209970825@cvsserver> |
amir Mon May 5 07:00:25 2008 UTC
Modified files:
/pearbot/modules pearbugs.php pearcvscommits.php
Log:
- Fixing the same type but from another place
- Cosmetics
http://cvs.php.net/viewvc.cgi/pearbot/modules/pearbugs.php?r1=1.2&r2=1.3&diff_format=u
Index: pearbot/modules/pearbugs.php
diff -u pearbot/modules/pearbugs.php:1.2 pearbot/modules/pearbugs.php:1.3
--- pearbot/modules/pearbugs.php:1.2 Sun May 4 13:26:16 2008
+++ pearbot/modules/pearbugs.php Mon May 5 07:00:25 2008
@@ -1,9 +1,9 @@
<?php
/**
- * $Id: pearbugs.php,v 1.2 2008/05/04 13:26:16 amir Exp $
- * $Revision: 1.2 $
+ * $Id: pearbugs.php,v 1.3 2008/05/05 07:00:25 amir Exp $
+ * $Revision: 1.3 $
* $Author: amir $
- * $Date: 2008/05/04 13:26:16 $
+ * $Date: 2008/05/05 07:00:25 $
*
* Copyright (c) 2006 Amir Mohammad Saied <[email protected]>
*/
@@ -16,7 +16,7 @@
var $name = 'pearbugs';
var $description = 'Will return PEAR bugs info';
var $author = 'Amir Mohammad Saied <[email protected]>';
- var $version = '$Revision: 1.2 $';
+ var $version = '$Revision: 1.3 $';
var $license = 'GPL';
var $actionids = array();
@@ -46,8 +46,8 @@
$bugurl .= (int)$data->messageex[1];
$req =& new HTTP_Request($bugurl);
$req->setMethod(HTTP_REQUEST_METHOD_GET);
- $req->sendRequest();
- if (PEAR::isError($req->sendRequest())) {
+ $reqError = $req->sendRequest();
+ if (PEAR::isError($reqError)) {
$irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel,
'Connection to PEAR server failed!');
} else {
http://cvs.php.net/viewvc.cgi/pearbot/modules/pearcvscommits.php?r1=1.2&r2=1.3&diff_format=u
Index: pearbot/modules/pearcvscommits.php
diff -u pearbot/modules/pearcvscommits.php:1.2 pearbot/modules/pearcvscommits.php:1.3
--- pearbot/modules/pearcvscommits.php:1.2 Sun May 4 22:19:56 2008
+++ pearbot/modules/pearcvscommits.php Mon May 5 07:00:25 2008
@@ -1,9 +1,9 @@
<?php
/**
- * $Id: pearcvscommits.php,v 1.2 2008/05/04 22:19:56 amir Exp $
- * $Revision: 1.2 $
+ * $Id: pearcvscommits.php,v 1.3 2008/05/05 07:00:25 amir Exp $
+ * $Revision: 1.3 $
* $Author: amir $
- * $Date: 2008/05/04 22:19:56 $
+ * $Date: 2008/05/05 07:00:25 $
*
* Copyright (c) 2008 Amir Mohammad Saied <[email protected]>
*/
@@ -16,13 +16,13 @@
var $name = 'pearcvscommits';
var $description = 'Will return PEAR CVS commits';
var $author = 'Amir Mohammad Saied <[email protected]>';
- var $version = '$Revision: 1.2 $';
+ var $version = '$Revision: 1.3 $';
var $license = 'GPL';
var $lastMessageID = 0;
var $parsedFeed = '';
var $maxToPost = 3;
- var $timeout = 600000;
+ var $timeout = 420000;
var $silent = false;
var $actionids = array();
@@ -32,7 +32,8 @@
{
$this->actionids[] = $irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL,
'^!cvs', $this, 'talk');
- $this->timeids[] = $irc->registerTimehandler($this->timeout, $this, 'postSummary');
+ $this->timeids[] = $irc->registerTimehandler($this->timeout, $this,
+ 'postSummary');
}
function module_exit(&$irc)
@@ -47,13 +48,16 @@
if (isset($data->messageex[1])) {
if (strtolower($data->messageex[1]) == "on") {
$this->silent = false;
- $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, "OK, I'll tell you about CVS commits");
+ $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel,
+ "OK, I'll tell you about CVS commits");
} else if (strtolower($data->messageex[1]) == "off") {
$this->silent = true;
- $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, "Shhhhh " . $data->nick . ' gonna sleep');
+ $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, "Shhhhh ".
+ $data->nick . ' gonna sleep');
}
} else {
- $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $data->nick . ' Usage: !cvs on|off');
+ $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel,
+ $data->nick . ' Usage: !cvs on|off');
}
}
@@ -64,7 +68,8 @@
if (PEAR::isError($this->parsedFeed) || empty($this->parsedFeed)) {
return false;
}
- $lastID = explode('/', $this->parsedFeed['channel']['item']['19']['link']);
+ $lastID = explode('/',
+ $this->parsedFeed['channel']['item']['19']['link']);
$lastID = $lastID[4];
if ($this->silent) {
$this->lastMessageID = $lastID;
@@ -75,11 +80,14 @@
$this->lastMessageID = $lastID;
} else if ($this->lastMessageID < $lastID) {
$finalOutput = array();
- $queueItems = ($lastID - $this->lastMessageID) > $this->maxToPost ? $this->maxToPost : $lastID - $this->lastMessageID;
+ $queueItems = ($lastID - $this->lastMessageID) > $this->maxToPost ?
+ $this->maxToPost : $lastID - $this->lastMessageID;
while($queueItems) {
$item = $this->parsedFeed['channel']['item'][20 - $queueItems];
- $finalOutput[] = '"'.html_entity_decode(strip_tags($item['description'])) . '" has had a commit on ' . str_replace("cvs: ", "", $item['title']);
- $finalOutput[] = $item['link'];
+ $finalOutput[] = '"'.str_replace(" "," ",
+ strip_tags($item['description'])) . '" committed to '.
+ str_replace("cvs: ", "", $item['title']) . ' ['.
+ $item['link'].']';
$queueItems--;
}
$this->lastMessageID = $lastID;