Bitcoin Forum
December 06, 2016, 12:11:22 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [CLOSED] BOUNTY: 10 BTC for a simple script  (Read 1009 times)
Trader Steve
Hero Member
*****
Offline Offline

Activity: 725


"How do you eat an elephant? One bit at a time..."


View Profile
December 23, 2011, 12:57:10 PM
 #1

Greetings Coders,

I am looking for a simple script that will do the following:

Display the price of 1 gram of silver in U.S. dollars

Additional info:

The spot price of silver is usually quoted in troy ounces on sites like www.kitco.com. Here is the conversion formula:

1 troy ounce = 31.1034768 grams

Please PM me if you are interested.

Thanks,
Trader Steve
1481026282
Hero Member
*
Offline Offline

Posts: 1481026282

View Profile Personal Message (Offline)

Ignore
1481026282
Reply with quote  #2

1481026282
Report to moderator
1481026282
Hero Member
*
Offline Offline

Posts: 1481026282

View Profile Personal Message (Offline)

Ignore
1481026282
Reply with quote  #2

1481026282
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481026282
Hero Member
*
Offline Offline

Posts: 1481026282

View Profile Personal Message (Offline)

Ignore
1481026282
Reply with quote  #2

1481026282
Report to moderator
1481026282
Hero Member
*
Offline Offline

Posts: 1481026282

View Profile Personal Message (Offline)

Ignore
1481026282
Reply with quote  #2

1481026282
Report to moderator
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1442



View Profile
December 23, 2011, 01:17:20 PM
 #2

php?

sadpandatech
Hero Member
*****
Offline Offline

Activity: 504



View Profile
December 23, 2011, 07:14:56 PM
 #3

Do you have your own feed source for the data?

If you're not excited by the idea of being an early adopter 'now', then you should come back in three or four years and either tell us "Told you it'd never work!" or join what should, by then, be a much more stable and easier-to-use system. - GA
It is being worked on by smart people. -DamienBlack
grue
Global Moderator
Legendary
*
Offline Offline

Activity: 1932



View Profile
December 23, 2011, 07:25:04 PM
 #4

more info please:

what scripting language?
which site to get the info from?

It is pitch black. You are likely to be eaten by a grue.

Tired of annoying signature ads? Ad block for signatures
mcorlett
Donator
Sr. Member
*
Offline Offline

Activity: 308



View Profile
December 23, 2011, 07:38:13 PM
 #5

Code:
<?php
$decimals 
2;

$ticker json_decode(file_get_contents('http://drayah.no.de/metals/latest'), TRUE);
$silver $ticker['silver']['quote'];

echo 
round($silver/31.1034768$decimals);
?>

drayah's node.js box parses the prices from kitco.com.

Update: Here's a version that fallbacks to http://services.packetizer.com/spotprices/ if drayah's service is down (I'm keeping the old one for posterity):
Code:
<?php
$decimals 
2;

$drayah json_decode(file_get_contents('http://drayah.no.de/metals/latest'), TRUE);
if (
$drayah['silver']['quote'] > 0) {
$silver $drayah['silver']['quote'];
} else {
$packetizer = new SimpleXMLElement(file_get_contents('http://services.packetizer.com/spotprices/?f=xml'));
$silver $packetizer->silver;
}

echo 
round($silver/31.1034768$decimals);
?>
Update 2: Made another change should drayah's service be up but kitco down.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!