Bitcoin Forum
May 03, 2024, 08:35:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Bitcoin Price Image Generator  (Read 7066 times)
fizzisist (OP)
Hero Member
*****
Offline Offline

Activity: 720
Merit: 525



View Profile WWW
March 10, 2013, 08:19:04 PM
Last edit: February 24, 2014, 01:37:08 PM by fizzisist
Merited by hugeblack (15), LoyceV (10)
 #1

I wanted a little weekend project and it seemed like there was a need for this!

The bitcoin price image generator is a simple tool that creates a dynamic image of a price in BTC, based on a fixed USD price. The resulting image can be embedded in a forum post, for example, and it will always show an up-to-date BTC equivalent price. This is useful when you want to show a price for something in BTC, but you want the price to be pinned to a USD value (and not have to update your post every day as the BTC/USD exchange rate fluctuates). This tool relies on the ticker from BitcoinAverage.com.

Usage
Simply build a URL of the form:

Code:
http://btc-priceimg.herokuapp.com/img/<price_in_usd>

Where <price_in_usd> is the price you want in USD.

You can also add an optional color argument to change the color of the text:

Code:
http://btc-priceimg.herokuapp.com/img/<price_in_usd>/<color>

The color code should be an html-like hex code (for black: '000000' or '000' or simply '0'). The background of the image will be transparent.

Example
Say you want to sell an item for $10. You can generate an image using:
http://btc-priceimg.herokuapp.com/img/10.00

Which will yield the image:

If you want to change the color (to more closely match the text in your forum post, for example), use:
http://btc-priceimg.herokuapp.com/img/10.00/00f

Which yields:

You can then embed the image in your post using that URL. In BBCode, this would be:

Code:
[img]http://btc-priceimg.herokuapp.com/img/10.00[/img]

Please let me know what you think! Any suggestions?

1714768548
Hero Member
*
Offline Offline

Posts: 1714768548

View Profile Personal Message (Offline)

Ignore
1714768548
Reply with quote  #2

1714768548
Report to moderator
1714768548
Hero Member
*
Offline Offline

Posts: 1714768548

View Profile Personal Message (Offline)

Ignore
1714768548
Reply with quote  #2

1714768548
Report to moderator
1714768548
Hero Member
*
Offline Offline

Posts: 1714768548

View Profile Personal Message (Offline)

Ignore
1714768548
Reply with quote  #2

1714768548
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714768548
Hero Member
*
Offline Offline

Posts: 1714768548

View Profile Personal Message (Offline)

Ignore
1714768548
Reply with quote  #2

1714768548
Report to moderator
1714768548
Hero Member
*
Offline Offline

Posts: 1714768548

View Profile Personal Message (Offline)

Ignore
1714768548
Reply with quote  #2

1714768548
Report to moderator
1714768548
Hero Member
*
Offline Offline

Posts: 1714768548

View Profile Personal Message (Offline)

Ignore
1714768548
Reply with quote  #2

1714768548
Report to moderator
Mike Christ
aka snapsunny
Legendary
*
Offline Offline

Activity: 1078
Merit: 1003



View Profile
March 10, 2013, 08:25:13 PM
 #2

Shows up great on my thread!  Thanks for this Smiley

On this note, the prices seem to come out a tad higher than what MT Gox is saying...hrmmm

fizzisist (OP)
Hero Member
*****
Offline Offline

Activity: 720
Merit: 525



View Profile WWW
March 10, 2013, 08:32:41 PM
 #3

Shows up great on my thread!  Thanks for this Smiley

On this note, the prices seem to come out a tad higher than what MT Gox is saying...hrmmm

Cool! One thing (to be safe) might be to put the USD price there in text too, just in case something goes wrong with my tool. Either if the image won't load or the price is wrong because of some error on my part. I wouldn't want you to feel obligated to sell something at a crazy low price if I screwed up!

The price could differ from Mt Gox slightly because it uses the 24 hour average, or because I'm caching the exchange rate for five minutes. Hopefully this never causes a significant discrepancy.

edd
Donator
Legendary
*
Offline Offline

Activity: 1414
Merit: 1001



View Profile WWW
March 10, 2013, 09:25:25 PM
 #4

Middle link in your sig is broken - missing the .com

Still around.
fizzisist (OP)
Hero Member
*****
Offline Offline

Activity: 720
Merit: 525



View Profile WWW
March 10, 2013, 09:26:09 PM
 #5

Middle link in your sig is broken - missing the .com

Thanks Smiley

Vod
Legendary
*
Offline Offline

Activity: 3696
Merit: 3057


Licking my boob since 1970


View Profile WWW
March 10, 2013, 10:28:21 PM
Last edit: March 10, 2013, 11:01:46 PM by mlawrence
 #6

Some users may not want precision to 4 decimal places.

You could add a variable to let the price auto round up(down?) to the nearest precision wanted.

It would add a bit more stability when the price fluctuates so much.

https://nastyscam.com - landing page up     https://vod.fan - advanced image hosting - coming soon!
OGNasty has early onset dementia; keep this in mind when discussing his past actions.
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
March 11, 2013, 11:54:14 AM
 #7

I wanted a little weekend project and it seemed like there was a need for this!

There sure is!

Nice work.

This one is decent too:
 - http://btcticker.appspot.com/mtgox/1btc2usd.png


 - http://btcticker.appspot.com/mtgox/100.00gbp.png

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


fizzisist (OP)
Hero Member
*****
Offline Offline

Activity: 720
Merit: 525



View Profile WWW
March 11, 2013, 06:37:56 PM
 #8

I wanted a little weekend project and it seemed like there was a need for this!

There sure is!

Nice work.

This one is decent too:
 - http://btcticker.appspot.com/mtgox/1btc2usd.png


 - http://btcticker.appspot.com/mtgox/100.00gbp.png


Oh, cool! I hadn't seen that. Some pretty cool features in that one. I think mine does a better job at blending in as text (although that still needs more work), but I'm glad to see there's another option for people wanting to do more sophisticated things!

BTC4Amazon
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile WWW
April 26, 2013, 12:38:04 AM
 #9

Any Chance you could make one similar but for the popular alt coins, I would definitely give you a nice tip for that Cheesy
fizzisist (OP)
Hero Member
*****
Offline Offline

Activity: 720
Merit: 525



View Profile WWW
April 26, 2013, 03:47:41 PM
 #10

Any Chance you could make one similar but for the popular alt coins, I would definitely give you a nice tip for that Cheesy

I'll gladly do that. All I need is an API to get exchange rates. Got a link?

BTC4Amazon
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile WWW
April 26, 2013, 05:18:10 PM
 #11

Any Chance you could make one similar but for the popular alt coins, I would definitely give you a nice tip for that Cheesy

I'll gladly do that. All I need is an API to get exchange rates. Got a link?
https://btc-e.com/api/documentation
fizzisist (OP)
Hero Member
*****
Offline Offline

Activity: 720
Merit: 525



View Profile WWW
April 27, 2013, 09:11:39 PM
 #12

Any Chance you could make one similar but for the popular alt coins, I would definitely give you a nice tip for that Cheesy

I'll gladly do that. All I need is an API to get exchange rates. Got a link?
https://btc-e.com/api/documentation

Ok, done! I added it at a separate URL (advimg). It accepts arguments as a GET request. Please test!

Example image:



Code:
http://fizzisist.com/priceimg/advimg?price=10.00&currency=LTC

Explanation is on the main page: http://fizzisist.com/priceimg

BTC4Amazon
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile WWW
April 28, 2013, 05:51:08 AM
 #13

Any Chance you could make one similar but for the popular alt coins, I would definitely give you a nice tip for that Cheesy

I'll gladly do that. All I need is an API to get exchange rates. Got a link?
https://btc-e.com/api/documentation

Ok, done! I added it at a separate URL (advimg). It accepts arguments as a GET request. Please test!

Example image:



Code:
http://fizzisist.com/priceimg/advimg?price=10.00&currency=LTC

Explanation is on the main page: http://fizzisist.com/priceimg
A tip is headed your way fine dir, I thank you
bernard75
Legendary
*
Offline Offline

Activity: 1316
Merit: 1003



View Profile
August 14, 2013, 05:58:36 AM
 #14

Could you provide 24h average?
Mike Christ
aka snapsunny
Legendary
*
Offline Offline

Activity: 1078
Merit: 1003



View Profile
December 11, 2013, 11:58:09 PM
 #15

Something's going wrong Sad Now the images aren't showing up.

bernard75
Legendary
*
Offline Offline

Activity: 1316
Merit: 1003



View Profile
December 12, 2013, 10:22:08 AM
 #16

Something's going wrong Sad Now the images aren't showing up.
I see the images just fine.
Its just that the forum is caching images through a third party now, which yields wrong results for quotes already cached.
fizzisist (OP)
Hero Member
*****
Offline Offline

Activity: 720
Merit: 525



View Profile WWW
December 12, 2013, 12:53:53 PM
 #17

Something's going wrong Sad Now the images aren't showing up.
Error: Mt Gox error

Yeah, it looks like the Mt Gox API was down for a bit. I'm thinking about switching to a different exchange, or maybe even making it an average of a few. Any suggestions of which one(s) I should use?

It would also be possible to let the user specify the exchange to use when generating the image.

Thoughts?

bluemeanie1
Sr. Member
****
Offline Offline

Activity: 280
Merit: 257


bluemeanie


View Profile WWW
December 12, 2013, 07:01:27 PM
 #18

I wanted a little weekend project and it seemed like there was a need for this!

The bitcoin price image generator is a simple tool that creates a dynamic image of a price in BTC, based on a fixed USD price.
Please let me know what you think! Any suggestions?

Security Alert!

this device shares your web usage data with the owner of fizzisist.com for every page you embed the widget in.

Just who IS bluemeanie?    On NXTautoDAC and a Million Stolen NXT

feel like your voice isn't being heard? PM me.   |   stole 1M NXT?
TheButterZone
Legendary
*
Offline Offline

Activity: 3052
Merit: 1031


RIP Mommy


View Profile WWW
August 13, 2014, 11:37:22 PM
 #19

http://btc-priceimg.herokuapp.com/img/100

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Code:
[img]http://btc-priceimg.herokuapp.com/img/100[/img]

Saying that you don't trust someone because of their behavior is completely valid.
TheButterZone
Legendary
*
Offline Offline

Activity: 3052
Merit: 1031


RIP Mommy


View Profile WWW
August 15, 2014, 12:31:10 AM
 #20

It's fixed.

I wanted a little weekend project and it seemed like there was a need for this!

The bitcoin price image generator is a simple tool that creates a dynamic image of a price in BTC, based on a fixed USD price.
Please let me know what you think! Any suggestions?

Security Alert!

this device shares your web usage data with the owner of fizzisist.com for every page you embed the widget in.

I don't think it can do that on here through the new bitcointalk image proxy.

Saying that you don't trust someone because of their behavior is completely valid.
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!