westinpigott / wrenchpusher Goto Github PK
View Code? Open in Web Editor NEWPusher Client for PHP - Get messages pushed to PHP!
Pusher Client for PHP - Get messages pushed to PHP!
PHP Warning: Invalid argument supplied for foreach() in /home/pi/PHP_Pusher_Client/index.php on line 33
We should log any errors into a file so they can be reviewed
Several people have starred and watched this repo. I am hoping to find what your use cases are so that I can make sure I account for them when I begin working on a useful library ( version 2 ).
I will leave this open for awhile so we can get a decent list going.
Hey, trying to connect to: https://www.bitstamp.net/websocket/
I am only returning one Event with the following script Event:pusher:pong , says Channel is NULL even though seems to subscribe. Can you point me in the right direction please.
Code I'm using:
//enter your ap key here.
define('APP_KEY', 'de504dc5763aeef9ff52');
//create the pusher connection
$client = new WrenchPusher\PusherClient(APP_KEY, array(
'isSecure' => TRUE,
'keepAliveDuration' => 5,
));
$client->connect();
//subscribe to a channel
$channelName = 'live_trades';
$client->subscribeToChannel($channelName) or die("Error Subscribing to channel.");
echo 'Subscribed to channel: ' . $channelName . "\n";
//let it listen forever
while (true) {
$client->keepAlive();
$responses = $client->receive();
foreach ($responses as $response) {
/* @var $response WrenchPusher\PusherMessage */
echo 'Event:' . $response->getEvent() . "\n";
echo 'Channel:' . $response->getChannel() . "\n";
echo 'Data: ';
$data = $response->getData();
if (is_array($data) || ($data instanceof Traversable) || ($data instanceof stdClass)) {
echo "\n";
foreach ($data as $id => $row) {
echo ' ' . $id . ' : ' . $row . "\n";
}
} else {
echo $data."\n";
}
echo "--------------------------------------------------------\n";
}
}
Need to look at http://pusher.com/docs/pusher_protocol for details.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.