Bitcoin Forum
June 16, 2024, 11:23:56 PM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Alternate cryptocurrencies / Mining (Altcoins) / Re: [ANN] Dogecoin Pool doge.scryptpools.com - 2% fee on: December 19, 2013, 01:56:40 PM
Having problems connecting with Stratum proxy where I wasnt having them a few hours ago. Wasup?
2  Economy / Service Discussion / Re: LocalBitcoins freakout on: December 08, 2013, 11:33:36 PM
After 3 hours they are in. What, The, hell. Never again
3  Economy / Service Discussion / Re: LocalBitcoins freakout on: December 08, 2013, 11:03:06 PM
Same here, 8 confirms at the moment

28 confirmations here.... and it is still showing as an "unconfirmed balance" in my account with 0 confirmations.

I am getting really angry
4  Economy / Service Discussion / Re: LocalBitcoins freakout on: December 08, 2013, 10:43:43 PM
Having this same. Fucking. Issue.
5  Other / Beginners & Help / Re: MtGox Streaming API Question on: April 09, 2013, 12:01:06 PM
Hrmmmm.

Crap. I'm not sure then. I've been up all night and it's 8:02 I can barely stay awake Sad I'll try again in a few hours
6  Other / Beginners & Help / Re: MtGox Streaming API Question on: April 09, 2013, 11:30:47 AM
ok this

Code:
 LogTextToConsole(output, msg.ticker.last.display_[Suspicious link removed]String()); 

don't know why this keeps saying that but it is supposed to be display_short and then .toString()

edit: double edit, damn I gotta hit the sack soon I am tired. Messing up

Code:
ob.insertBefore(divText, ob.firstChild);
ob.firstChild was console.firstChild i switched it to ob.firstChild (what it is supposed to be).

now all should work fine... I hope
7  Other / Beginners & Help / Re: MtGox Streaming API Question on: April 09, 2013, 11:13:42 AM
Ok so here is the code you are looking for (and one of my homemade functions, enjoy). This works and should show you what you want.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="https://socketio.mtgox.com/socket.io/socket.io.js"></script>

</head>

<body>
<div id="output">
</div>
<script>
    
var mtgox = io.connect("http://socketio.mtgox.com/mtgox");

var ticker = "d5f06780-30a8-4a48-a2f8-7ed181b4a13f";
var trade = "dbf1dee9-4f2e-4a08-8cb7-748919a71b21";
var depth = "24e67e0d-1cad-4cc0-9e7a-f8523ef460fe";

var output = document.getElementById("output");

mtgox.on("connect", function(e) {

LogTextToConsole(output, "Connected");

mtgox.send({
"channel":depth,
"op":"unsubscribe"
});

LogTextToConsole(output, "Unsubscribed from Depth");

mtgox.on("message", function(msg) {

if( (msg.channel == ticker) && (msg.origin == "broadcast") ) {
LogTextToConsole(output, msg.ticker.last.display_[Suspicious link removed]String());
}

});

});

function LogTextToConsole(ob, inc, b, c) {

// Create Div Container for Object and assign Class Name
var divText = document.createElement("div");
var defaultColor = '#FFFFFF';
c = c || defaultColor;
b = b || false;

divText.className = "divStringHolder";

// Check to see if the object is a string, if it is display it.
if (typeof inc == "string") {

// Assign text to div
divText.textContent = inc;

// If bold, bold it
if (b == true) {

// Adds bold if requested
divText.style.fontWeight = "bold";
}

if (c != defaultColor) {
// Changes from the default to something specified
divText.style.backgroundColor = c;
}
else {
// Default Notification Color
divText.style.backgroundColor = defaultColor;
}

/* IMPORTANT: Inserts before the first child therefore creating a
* top to bottom effect where the newest information is on the top
* and the oldest is on the bottom */
ob.insertBefore(divText, ob.firstChild);
}

}
</script>
</body>
</html>

http://www.introspectivity.com/TradeThatCoin/testcode.php

What I think was going wrong for you was where you had your script. I've always seen them at the bottom of the body for sockets, that's where I've been putting mine anywhere with no problems.

also biggest thing they don't specifically tell you

Code:
mtgox.send({ 
     "channel":depth,
     "op":"unsubscribe"
});

That is how you unsubscribe and subscribe to channels. If you need help subscribing to the lag channel later to late me know Smiley I didn't realize the socket io and the websocket were that close in syntax

Edit: had to change some of the leftover code from mine
8  Other / Beginners & Help / Re: MtGox Streaming API Question on: April 09, 2013, 10:45:54 AM
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="https://socketio.mtgox.com/socket.io/socket.io.js"></script>

</head>

<body>
<script>
   
var mtgox = io.connect("http://socketio.mtgox.com/mtgox");

mtgox.on("connect", function(e) {

console.log('connected');

mtgox.on("message", function(msg) {

console.log(msg.channel);
});

});
</script>
</body>
</html>

This so far is listing the channels as they come in. Everytime the server sends out one of the channels (ticker, depth, or trades) it lists the channel in the console. I am now going to try and do the other part you were working on
9  Other / Beginners & Help / Re: MtGox Streaming API Question on: April 09, 2013, 10:36:16 AM
Trying to work on your code right now bud - should have a solution for you and reasoning here in like 15
10  Other / Beginners & Help / Re: MtGox Streaming API Question on: April 09, 2013, 09:48:15 AM
bump
11  Other / Beginners & Help / Re: Did I get scammed - www.buybitcoin.com on: April 09, 2013, 09:38:46 AM
Silk Road for bitcoins if you really want to stay away from the trade centers. Atleast they have a middle man system (not that it works 100% of the time).
12  Other / Beginners & Help / MtGox Streaming API Question on: April 09, 2013, 09:20:54 AM
Working on a trade ticker. I know there are a good chunk of these already but I am working on a personal one for me and a few friends. Figure my server would be able to handle me and 2 other people better than trying to squeeze in with 5000 other people.

Anywho... was going to post in https://bitcointalk.org/index.php?topic=5855.340 but I guess I have to do it here for now

http://www.introspectivity.com/TradeThatCoin/ - The product of a few hours worth of work today (and learning how to use WebSockets, small pain in the ass but fairly easy!). I am noticing that however I don't stay connected for long with the mtgox streaming api on my site and that other websites like bitcoin.clarkmoody.com connection stay alive a lot longer.

Currently in my code I am unsubscribed from 2 channels, would this have an effect? Maybe because things aren't getting pushed as much? If this is the case I thought websockets was supposed to just remain alive?

I am pretty confused as far as that goes. Not really sure what to do to fix that.

Edit: P.S Go easy on me as far as looks... This is no where near the finished version. Just needed a console to look @ output while I hammer all the bugs out then drastically change the layout (gonna be more for mobile - Clarks unfortunately doesn't have a mobile version)
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!