forked from GNUsocial/gnu-social
Merge in Phergie fixes and remove some whitespace
This commit is contained in:
parent
3c1d7d81cf
commit
dd882be803
@ -219,6 +219,14 @@ class Phergie_Driver_Streams extends Phergie_Driver_Abstract
|
|||||||
*/
|
*/
|
||||||
public function getEvent()
|
public function getEvent()
|
||||||
{
|
{
|
||||||
|
// Check the socket is still active
|
||||||
|
if (feof($this->socket)) {
|
||||||
|
throw new Phergie_Driver_Exception(
|
||||||
|
'EOF detected on socket',
|
||||||
|
Phergie_Driver_Exception::ERR_CONNECTION_READ_FAILED
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Check for a new event on the current connection
|
// Check for a new event on the current connection
|
||||||
$buffer = fgets($this->socket, 512);
|
$buffer = fgets($this->socket, 512);
|
||||||
if ($buffer === false) {
|
if ($buffer === false) {
|
||||||
|
@ -35,15 +35,24 @@ $xpath = new DOMXPath($doc);
|
|||||||
$cookies = $xpath->query('//table[@width="90%"]/tr/td[1]/a');
|
$cookies = $xpath->query('//table[@width="90%"]/tr/td[1]/a');
|
||||||
|
|
||||||
foreach ($cookies as $cookie) {
|
foreach ($cookies as $cookie) {
|
||||||
|
$name = $cookie->textContent;
|
||||||
$name = str_replace(array('(',')',"\n", 'cookies'), array('','', ' ', 'cookie' ), trim( $cookie->textContent));
|
foreach (range(0, mb_strlen($name) - 1) as $index) {
|
||||||
|
echo mb_strcut($name, $index, 1), PHP_EOL;
|
||||||
|
}
|
||||||
|
$name = str_replace(
|
||||||
|
array('(',')',"\n", 'cookies'),
|
||||||
|
array('','', ' ', 'cookie'),
|
||||||
|
$name
|
||||||
|
);
|
||||||
|
$name = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $name);
|
||||||
|
$name = trim($name);
|
||||||
|
$name = rtrim($name, 's');
|
||||||
|
|
||||||
$link = 'http://en.wikipedia.org' . $cookie->getAttribute('href');
|
$link = 'http://en.wikipedia.org' . $cookie->getAttribute('href');
|
||||||
$insert->execute(array($name, $link));
|
$insert->execute(array($name, $link));
|
||||||
print 'added ['.$name.'] -> '. $link . PHP_EOL;
|
echo 'added [' . $name . '] -> '. $link . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
echo 'Cleaning up', PHP_EOL;
|
echo 'Cleaning up', PHP_EOL;
|
||||||
unlink($file);
|
unlink($file);
|
||||||
|
|
||||||
|
Binary file not shown.
@ -64,8 +64,6 @@ class IrcManager extends ImManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Idle processing for io manager's execution loop.
|
* Idle processing for io manager's execution loop.
|
||||||
* Send keepalive pings to server.
|
* Send keepalive pings to server.
|
||||||
|
Loading…
Reference in New Issue
Block a user