Bitcoin Forum
October 17, 2019, 06:52:07 AM *
News: If you like a topic and you see an orange "bump" link, click it. More info.
 
   Home   Help Search Login Register More  
Pages: 1 2 [All]
  Print  
Author Topic: Bitcoin Price Image Generator  (Read 7024 times)
fizzisist
Hero Member
*****
Offline Offline

Activity: 720
Merit: 510



View Profile WWW
March 10, 2013, 08:19:04 PM
Last edit: February 24, 2014, 01:37:08 PM by fizzisist
Merited by 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?

1571295127
Hero Member
*
Offline Offline

Posts: 1571295127

View Profile Personal Message (Offline)

Ignore
1571295127
Reply with quote  #2

1571295127
Report to moderator
1571295127
Hero Member
*
Offline Offline

Posts: 1571295127

View Profile Personal Message (Offline)

Ignore
1571295127
Reply with quote  #2

1571295127
Report to moderator
1571295127
Hero Member
*
Offline Offline

Posts: 1571295127

View Profile Personal Message (Offline)

Ignore
1571295127
Reply with quote  #2

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

Posts: 1571295127

View Profile Personal Message (Offline)

Ignore
1571295127
Reply with quote  #2

1571295127
Report to moderator
1571295127
Hero Member
*
Offline Offline

Posts: 1571295127

View Profile Personal Message (Offline)

Ignore
1571295127
Reply with quote  #2

1571295127
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
Hero Member
*****
Offline Offline

Activity: 720
Merit: 510



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
Hero Member
*****
Offline Offline

Activity: 720
Merit: 510



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: 2898
Merit: 2308


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.

I'm into creating universes, smiting people, writing holy books and listening to Prayer Messages (PMs).
BitcoinTalk Public Information Project (BPIP)  - BPIP Reports
"Masturbation makes you feel good but doesn't do anything for the person you're thinking of.  Just like prayer."
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1001


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
Hero Member
*****
Offline Offline

Activity: 720
Merit: 510



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
Hero Member
*****
Offline Offline

Activity: 720
Merit: 510



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
Hero Member
*****
Offline Offline

Activity: 720
Merit: 510



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
Hero Member
*****
Offline Offline

Activity: 720
Merit: 510



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: 2562
Merit: 1011


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: 2562
Merit: 1011


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.
TheButterZone
Legendary
*
Offline Offline

Activity: 2562
Merit: 1011


RIP Mommy


View Profile WWW
August 17, 2014, 08:20:30 PM
Last edit: August 19, 2014, 03:59:59 AM by TheButterZone
 #21

And it's not following BitcoinAverage last; around 1.8 BTC short on a $21328 conversion right now. This is like the third or fourth unreliable ticker I've gone through.

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

Activity: 1316
Merit: 1003



View Profile
October 01, 2014, 07:35:12 AM
 #22

Could you add EUR support?
amacar
Hero Member
*****
Offline Offline

Activity: 546
Merit: 500


View Profile
December 02, 2014, 01:53:03 AM
Last edit: December 02, 2014, 02:35:23 AM by amacar
 #23

I made this:

But it is hosted on free server so I would really appreciate some donation or access to any server.
Link is:
Code:
[img] http://amacar.hostei.com/generateImage/index.php/?VALUE=10&CUR=USD&TYPE=24h_avg&TIMESTAMP=YES&PRECISION=7&COLOR=00FFFF&SIZE=12&FONT=calibri [/img]

Parameter VALUE is just amount you want to convert to BTC
Parameter CUR is currency and could be any value from: https://bitcoinaverage.com ('USD', 'EUR', 'GBP', 'CAD'...), default is USD.
Parameter TYPE could be 'ask', 'bid', '24h_avg', 'last', default is last.
If parameter TIMESTAMP is 'yes', then timestamp is added to image, otherwise no. Default is no timestamp added.
Parameter PRECISION allows you to round calculated value to decimals. Default is 5.
Parameter COLOR will change text color. Accept HEX values, default is black.
Parameter SIZE is size of text, default is 11.
FONT is font of text, default is arial.

Currently supported fonts (can add more):
bernard75
Legendary
*
Offline Offline

Activity: 1316
Merit: 1003



View Profile
December 02, 2014, 08:20:40 PM
 #24

Finally somebody has made the effort.
THX man.
amacar
Hero Member
*****
Offline Offline

Activity: 546
Merit: 500


View Profile
January 25, 2015, 12:05:55 PM
 #25

I changed address to
Code:
[img] http://pravicar.comyr.com/generateImage/index.php/?VALUE=10&CUR=USD&TYPE=24h_avg&TIMESTAMP=YES&PRECISION=7&COLOR=00FFFF&SIZE=12&FONT=calibri [/img]

because they closed my previous free hosting.

TheButterZone
Legendary
*
Offline Offline

Activity: 2562
Merit: 1011


RIP Mommy


View Profile WWW
July 06, 2015, 10:08:17 PM
 #26

I didn't really document it, but you can now pin the image to any currency supported by BitcoinAverage here: https://api.bitcoinaverage.com/ticker/global/
Code:
/advimg?price=10EUR

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

Activity: 2562
Merit: 1011


RIP Mommy


View Profile WWW
June 17, 2017, 09:11:00 PM
 #27

It's dead, Jim. https://github.com/fordhurley/btc-priceimg/issues/11

Saying that you don't trust someone because of their behavior is completely valid.
vh
Hero Member
*****
Offline Offline

Activity: 701
Merit: 657


View Profile
June 17, 2017, 10:08:38 PM
 #28

"This tool relies on the global weighted average from BitcoinAverage."

https://api.bitcoinaverage.com is down.

TheButterZone
Legendary
*
Offline Offline

Activity: 2562
Merit: 1011


RIP Mommy


View Profile WWW
June 18, 2017, 08:17:05 PM
 #29

https://twitter.com/BitcoinAverage/status/872523256112320512
"Our v1 API was depreciated 9months ago."

The moving target continues...
https://www.facebook.com/BitcoinAverage/posts/1438041052876868

Saying that you don't trust someone because of their behavior is completely valid.
Pages: 1 2 [All]
  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!