Bitcoin Forum
May 06, 2024, 03:37:40 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [20]
381  Economy / Securities / Re: [GLBSE] Bitdust - Make your bitdust work for you on: June 14, 2012, 04:39:18 AM
Sending pretty much any amount to the faucet would be seen as a "loss" by many and probably work well to discourage long term holding compared to other mining stocks. Sending it specifically to the fountain would be a great way to give back. Maybe even give it away each month to a different bitcoin charity?

The feature GLBSE is missing that would really help this kind of venture out is being able to place buy orders to execute once sufficient funds are available. This would eliminate the need to watch GLBSE like a hawk to take advantage, and then you could come in less frequently to sell shares and buy more expensive ones or whatever else you'd like to.
382  Economy / Securities / Re: [GLBSE] Google Docs Macros to automatically pull GLBSE data into spreadsheets on: June 10, 2012, 02:48:19 PM
This is something I posted  in another thread https://bitcointalk.org/index.php?topic=82076.msg940941#msg940941.

This is what I've been using, hopefully it helps someone. Everything is already returned in bitcoins, not satoshis though.
Code:
//Shrink an array down to at most 3 elements
//Helper function
function get3(info) {
//If you want more or less payouts, change this 3
  while(info.length > 3)
    info.shift();
  return info;
}

//Fetches asset info based on ticker
function getInfo(ticker) {
  return glbseCachedFetch("/api/asset/" + ticker);
}

//Fetches dividend info based on ticker
function getDiv(ticker) {
  return glbseCachedFetch("/api/dividends/asset/" + ticker);
}

//Fetches the price of an asset
//Returns first non-zero price from the list of 24h average, 5 day average, 7 day average, or last trade
function getPrice(ticker) {
  var info = getInfo(ticker);
  return (info.t24havg/100000000) || (info.t5davg/100000000) || (info.t7davg/100000000) || (info.latest_trade/100000000);
}

//Gets the average dividend from passed in array
function getDivArray(info) {
  Logger.log("Into getDivArray");
  if(info === null) return null;
  if(info.length == 0) return 0;
  Logger.log("Not null or zero length");
  var divTotal = 0;
  for(var i = 0; i < info.length; i++) {
    divTotal += info[i].pps;
    Logger.log("Step " + i + "/" + info.length + " " + String(divTotal));
  }
  Logger.log(String(divTotal));
  return divTotal / info.length / 100000000;
}
//Gets average dividend of all payouts
function getAvgDividend(ticker) {
  Logger.log("Into getAvgDividend " + ticker);
  var info = getDiv(ticker);
  Logger.log(info);
  Logger.log("Got Info");
  return getDivArray(info);
}
//Gets Average dividend of last 3 payouts
function get3AvgDividend(ticker) {
  var info = get3(getDiv(ticker));
  return getDivArray(info);
}

//Fetches info from GLBSE, caches when fetched and attempts to use the cache
//Caches info for 30 minutes
function glbseCachedFetch(apiUrl) {
  var publicCache = CacheService.getPublicCache();
  var cached = publicCache.get("http://glbse.com" + apiUrl);
  if(cached !== null && JSON.parse(cached).length > 1 ){
    return JSON.parse(cached);
  } else {
    getSleep();
    //Browser.msgBox("Fetching");
    Logger.log("Fetching");
    var response = UrlFetchApp.fetch("http://glbse.com"+apiUrl);
    //check for status code
    var result = response.getContentText();
    if(response.getResponseCode() < 300)//Only save if good fetch
      publicCache.put("http://glbse.com"+apiUrl, result, 60 * 30);//30 * 60 seconds - 30 minutes
    return JSON.parse(result);
  }
}

//Allows small delay between multiple fetches to lighten the load on GLBSE site
function getSleep() {
  var delay = 50;
  var date = new Date();
  var now = date.getTime();
  var cache = CacheService.getPublicCache();
  var cacheKey = "sleepUntil";
  var timeString = cache.get(cacheKey);
  var time = parseInt(timeString);
  var sleep = time - now;
 
  Logger.log(cacheKey + " " + timeString);
  Logger.log("parseInt " + time);
  Logger.log("sleeping " + sleep);
 
  if((timeString === null) || (timeString == "NaN") || (time === null) || (time == NaN) || (sleep < 0)) {
    cache.put(cacheKey, String(now + delay));
  } else {
    cache.put(cacheKey, String(time + delay));
    Utilities.sleep(sleep);
  }
}
//Days between payouts, based on all payouts
function daysBetween(ticker) {
  var info = getDiv(ticker);
  if(info === null) return null;
  if(info.length < 2) return Infinity;
  var first = info[0];
  var last = info.pop();
  return (last.timestamp - first.timestamp) / info.length / 3600 / 24;
}
//Days between payouts, based on the last 3 payouts
function daysBetween3(ticker) {
  var info = get3(getDiv(ticker));
  if(info === null) return null;
  if(info.length < 2) return Infinity;
  var first = info[0];
  var last = info.pop();
  return (last.timestamp - first.timestamp) / info.length / 3600 / 24;
}
These are the functions I'm using in my sheet, and while I'm not quite ready to show off the whole thing I hope this might be helpful to someone. I'm looking to get these published to the gallergy, but approval takes a while. These can be used regularly in a sheet as a docs formula or as a function on other scripts. These may be used as if under any license or as public domain where available.

Tips to 18ef54UQ3t9ieqU3MebyqMHjCpzKrZzS5N are greatly appreciated if you've got the spare coin and find these useful.
383  Economy / Securities / Re: GBLSE assets data spreadsheet on: June 04, 2012, 07:45:12 PM
This is what I've been using, hopefully it helps some
Code:
//Shrink an array down to at most 3 elements
//Helper function
function get3(info) {
//If you want more or less payouts, change this 3
  while(info.length > 3)
    info.shift();
  return info;
}

//Fetches asset info based on ticker
function getInfo(ticker) {
  return glbseCachedFetch("/api/asset/" + ticker);
}

//Fetches dividend info based on ticker
function getDiv(ticker) {
  return glbseCachedFetch("/api/dividends/asset/" + ticker);
}

//Fetches the price of an asset
//Returns first non-zero price from the list of 24h average, 5 day average, 7 day average, or last trade
function getPrice(ticker) {
  var info = getInfo(ticker);
  return (info.t24havg/100000000) || (info.t5davg/100000000) || (info.t7davg/100000000) || (info.latest_trade/100000000);
}

//Gets the average dividend from passed in array
function getDivArray(info) {
  Logger.log("Into getDivArray");
  if(info === null) return null;
  if(info.length == 0) return 0;
  Logger.log("Not null or zero length");
  var divTotal = 0;
  for(var i = 0; i < info.length; i++) {
    divTotal += info[i].pps;
    Logger.log("Step " + i + "/" + info.length + " " + String(divTotal));
  }
  Logger.log(String(divTotal));
  return divTotal / info.length / 100000000;
}
//Gets average dividend of all payouts
function getAvgDividend(ticker) {
  Logger.log("Into getAvgDividend " + ticker);
  var info = getDiv(ticker);
  Logger.log(info);
  Logger.log("Got Info");
  return getDivArray(info);
}
//Gets Average dividend of last 3 payouts
function get3AvgDividend(ticker) {
  var info = get3(getDiv(ticker));
  return getDivArray(info);
}

//Fetches info from GLBSE, caches when fetched and attempts to use the cache
//Caches info for 30 minutes
function glbseCachedFetch(apiUrl) {
  var publicCache = CacheService.getPublicCache();
  var cached = publicCache.get("http://glbse.com" + apiUrl);
  if(cached !== null && JSON.parse(cached).length > 1 ){
    return JSON.parse(cached);
  } else {
    getSleep();
    //Browser.msgBox("Fetching");
    Logger.log("Fetching");
    var response = UrlFetchApp.fetch("http://glbse.com"+apiUrl);
    //check for status code
    var result = response.getContentText();
    if(response.getResponseCode() < 300)//Only save if good fetch
      publicCache.put("http://glbse.com"+apiUrl, result, 60 * 30);//30 * 60 seconds - 30 minutes
    return JSON.parse(result);
  }
}

//Allows small delay between multiple fetches to lighten the load on GLBSE site
function getSleep() {
  var delay = 50;
  var date = new Date();
  var now = date.getTime();
  var cache = CacheService.getPublicCache();
  var cacheKey = "sleepUntil";
  var timeString = cache.get(cacheKey);
  var time = parseInt(timeString);
  var sleep = time - now;
 
  Logger.log(cacheKey + " " + timeString);
  Logger.log("parseInt " + time);
  Logger.log("sleeping " + sleep);
 
  if((timeString === null) || (timeString == "NaN") || (time === null) || (time == NaN) || (sleep < 0)) {
    cache.put(cacheKey, String(now + delay));
  } else {
    cache.put(cacheKey, String(time + delay));
    Utilities.sleep(sleep);
  }
}
//Days between payouts, based on all payouts
function daysBetween(ticker) {
  var info = getDiv(ticker);
  if(info === null) return null;
  if(info.length < 2) return Infinity;
  var first = info[0];
  var last = info.pop();
  return (last.timestamp - first.timestamp) / info.length / 3600 / 24;
}
//Days between payouts, based on the last 3 payouts
function daysBetween3(ticker) {
  var info = get3(getDiv(ticker));
  if(info === null) return null;
  if(info.length < 2) return Infinity;
  var first = info[0];
  var last = info.pop();
  return (last.timestamp - first.timestamp) / info.length / 3600 / 24;
}
These are the functions I'm using in my sheet, and while I'm not quite ready to show off the whole thing I hope this might be helpful to someone. I'm looking to get these published to the gallergy, but approval takes a while. These can be used regularly in a sheet as a docs formula or as a function on other scripts. These may be used as if under any license or as public domain where available.

Tips to 18ef54UQ3t9ieqU3MebyqMHjCpzKrZzS5N are greatly appreciated if you've got the spare coin and find these useful.
384  Economy / Securities / Re: GLBSE disaster planning on: May 28, 2012, 06:31:35 PM
There's at least three threads making noise about the downtime already. https://bitcointalk.org/index.php?topic=75802.msg926975#msg926975 Nefario has already posted in one thread. Everything's okay but it spooked a lot of people.
385  Other / Off-topic / Re: whats the current wait time on the BitForce SHA256 Single on: May 24, 2012, 08:30:42 PM
I just ordered one today, and while customer service is extremely fast, they said that lead time was 9 weeks. That's as of today May 24th
386  Other / Beginners & Help / Re: Newbie restrictions on: May 23, 2012, 07:04:50 AM
Even though this post will likely get buried in a week never to be seen again, if you're accepted for whitelisting you'll receive a PM, and for the time I am still ranked as a "Newbie" so that's not as definitive as I figured. I was however whitelisted fairly quickly, though since I was looking for the wrong thing I may have missed it by a day or so.

I hope this helps someone else out at least
387  Other / Beginners & Help / Re: Whitelist Requests (Want out of here?) on: May 22, 2012, 02:30:15 AM
I've been following bitcoin for a bit, I've been slowly gambling (and actually making a small amount of money with it, dollars though, nothing major) on bitcoinduit and bidonbitcoins. I just bought my first shares on GLBSE today (Two shares of BDK). And the newbie restrictions have twice pushed me to decide not to register, but I finally decided that it was a good enough idea to do. I'm generally quiet and probably won't use the forums to post too much (although it's a great resource for support), however I'd still love to be unlocked without making  training wheel posts and even more quietly lurking.

My first bitcoin transaction was from the faucet on 3/28/11 receiving 0.05 bitcoins, I have since gathered ~200 transactions, though mostly small ones. Even if I don't get let out early, I'm still 20% of the way closer I figure  Smiley
388  Other / Beginners & Help / Re: Newbie restrictions on: May 22, 2012, 02:19:07 AM
I dont like it.. Trolls have time and will simply colltect that 5 posts in a few minutes... I they had no time they wouldnt troll around.. And other users dont get it why they cant post..
It takes a lot more dedication to register, make five legitimate posts, and surf the forums for a few hours than to fill out a captcha or something. And I doubt it's perfect, but it does help.
389  Other / Beginners & Help / Re: Newbie restrictions on: May 21, 2012, 12:08:24 AM
Even if I don t like these restrictions...I guess they are necessary  Undecided
This is pretty much my thoughts exactly, while I'm glad the issue (that I wasn't here for though) is at least greatly reduced, this is still a pain.  Signed up to post asking for coins back from the glitch on bitcoinduit. Good luck to all the other souls on here.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [20]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!