Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hf ~/bitfunder | php -f amc.php| less
- hf ~/bitfunder | cat amc.php
- <?php
- include('simple_html_dom.php');
- $html = file_get_html('https://bitfunder.com/assetlist');
- $items = array();
- $sum = 0;
- $number = 0;
- foreach($html->find('tr') as $line) {
- if(is_object($line)) {
- $item = array();
- $item['asset'] = $line->find('td', 0)->plaintext;
- $item['number'] = str_replace(',', '', $line->find('td', 1)->plaintext);
- $item['address'] = $line->find('td', 2)->plaintext;
- if($item['asset'] === 'AMC') {
- $sum = $sum + $item['number'];
- $number++;
- $items[] = $item;
- }
- }
- }
- array_multisort($items, SORT_DESC);
- for($x = 12; $x > 0; $x--) {
- if($x == 10) {
- echo "----------\n";
- }
- echo number_format($items[12-$x]['number'], 0, '', ',')."\n";
- }
- echo "\nShares sold:\t\t".number_format($sum, 0, '', ',')."\n";
- echo "Shareholder count:\t".number_format($number, 0, '', ',')."\n\n";
- echo "Full recap:\n";
- foreach($items as $i) {
- echo number_format($i['number'], 0, '', ',')."\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment