Skip to content

Instantly share code, notes, and snippets.

View bigprof's full-sized avatar

BigProf Software bigprof

View GitHub Profile
@bigprof
bigprof / automate.js
Created June 22, 2016 19:44
Automating phantomJS using jQuery
/*
To automate phantomjs using jQuery
See also: https://github.com/ariya/phantomjs/blob/master/examples/page_events.js
*/
var url = 'http://www.sample.com'; // start url
var eval_code = function() {
// code to execute here. Use 'page' instance to navigate to other urls if needed
$("button").click();
}
<?php
/* use this code as a guide for how to fetch bitcoin historical trade data from bitcoincharts, based on Bitstamp.net */
/* historical interval in hours */
define('AVERAGE_INTERVAL', 6);
$hist = file("http://api.bitcoincharts.com/v1/trades.csv?symbol=bitstampUSD&start=" . (time() - AVERAGE_INTERVAL * 3600));
if(!is_array($hist)) die("Unable to fetch data .. Try again later!");