Giter Club home page Giter Club logo

wrenchpusher's People

Contributors

westinpigott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

martinsv

wrenchpusher's Issues

What are some use cases?

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.

Trying to get it to work

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";
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.