Bitcoin Forum
July 24, 2019, 01:49:08 AM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin & Altcoins Live Price Image generator  (Read 380 times)
edgycorner
Full Member
***
Offline Offline

Activity: 505
Merit: 224

ψkek


View Profile
May 02, 2018, 03:15:06 PM
Last edit: May 28, 2018, 07:16:11 PM by edgycorner
Merited by roslinpl (42), Real14Hero (10), Joel_Jantsen (4), Vod (3), reflector (1)
 #1

I have created a simple project, which will generates image with live price of any crypto-currency.It can embedded in posts as an image.

By using this simple URL:

Code:
http://liveimage-liveimage.193b.starter-ca-central-1.openshiftapps.com/image.php?coin=NAME

With amount:
Code:
http://liveimage-liveimage.193b.starter-ca-central-1.openshiftapps.com/image.php?coin=NAME&amount=AMOUNT

With currency and amount:
Code:
http://liveimage-liveimage.193b.starter-ca-central-1.openshiftapps.com/image.php?coin=NAME&amount=AMOUNT&currency=CURRENCY

Currency:usd/aud/inr etcetra

Replace "NAME" with the coin name( ex:bitcoin,litecoin,ripple,etheruem,bitcoincash,eos,etcetra) and "AMOUNT" with a number.



Examples:

Code:
[img]http://liveimage-liveimage.193b.starter-ca-central-1.openshiftapps.com/image.php?coin=bitcoin[/img]
will generate:

Similarly,

3250 IOST Tokens:

1000 Tron:

1 Bitcoin in INR:



Domain Name?

Not yet decided.If you have anything in mind, then feel free to reply here Cheesy



Let me know, what you think about it.

Looks like after one load the cached image is showing up :c Can this be solved?
Update:The caching issue has been fixed Cheesy The images will be updated with live price after every reload.

You can see it working here: https://bitcointalk.org/index.php?topic=3485867



https://github.com/edgycorner/Coin-Price-Image-generator/
1563932948
Hero Member
*
Offline Offline

Posts: 1563932948

View Profile Personal Message (Offline)

Ignore
1563932948
Reply with quote  #2

1563932948
Report to moderator
1563932948
Hero Member
*
Offline Offline

Posts: 1563932948

View Profile Personal Message (Offline)

Ignore
1563932948
Reply with quote  #2

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

Activity: 1960
Merit: 1164


https://cryptocoinsinfo.net


View Profile WWW
May 04, 2018, 10:06:41 PM
Merited by edgycorner (5)
 #2

Hey,

this is actually very nice!

I see the image width is set to fixed - I suggest to calculate the image width after your script know the price.

Something like:
Image width = number of digits * 10px + 50px

1 digit is ~10px wide.
'USD' + some margins is ~50px.

Or you could limit the decimal.

I will keep my eye on your project Smiley
I wish you the best of luck!
edgycorner
Full Member
***
Offline Offline

Activity: 505
Merit: 224

ψkek


View Profile
May 05, 2018, 09:55:27 AM
 #3

Hey,

this is actually very nice!

I see the image width is set to fixed - I suggest to calculate the image width after your script know the price.

Something like:
Image width = number of digits * 10px + 50px

1 digit is ~10px wide.
'USD' + some margins is ~50px.

Or you could limit the decimal.

I will keep my eye on your project Smiley
I wish you the best of luck!

Thank you so much for being so generous.
Yes, I will work upon your suggestion.I will limit the decimals plus will change the width accordingly.Need to fix few other things too.

Thanks again Cheesy

vv181
Sr. Member
****
Offline Offline

Activity: 896
Merit: 329


Africans on forum, check my profile website


View Profile WWW
May 05, 2018, 11:01:31 AM
 #4

Domain Name?
cryptocapture
cryptotracker


Any information about the sources you gathered prices data?

adding an option to show the converted result in Bitcoin would be good.



.
r

▄▄███████████▄▄
▄███████████████████▄
▄███████████████████████▄
▄██████████████████████████▄
▄██  ███████▌ ▐██████████████▄
▐██▌ ▐█▀  ▀█    ▐█▀   ▀██▀  ▀██▌
▐██  █▌ █▌ ██  ██▌ ██▌ █▌ █▌ ██▌
▐█▌ ▐█ ▐█ ▐█▌ ▐██  ▄▄▄██ ▐█ ▐██▌
▐█  ██▄  ▄██    █▄    ██▄  ▄███▌
▀████████████████████████████▀
▀██████████████████████████▀
▀███████████████████████▀
▀███████████████████▀
▀▀███████████▀▀
..


.
PLAY NOW
reflector
Sr. Member
****
Offline Offline

Activity: 826
Merit: 263



View Profile
May 05, 2018, 01:00:37 PM
 #5

I have created a simple project, which will generates image with live price of any crypto-currency.It can embedded in posts as an image.

By using this simple URL:

Code:
http://35.226.164.123/image.php?coin=NAME&amount=AMOUNT

Replace "NAME" with the coin name( ex:bitcoin,litecoin,ripple,etheruem,bitcoincash,eos,etcetra) and "AMOUNT" with a number.



Examples:

Code:
[img]http://35.226.164.123/image.php?coin=bitcoin&amount=3[/img]
will generate:

Similarly,

3250 IOST Tokens:

1000 Tron:

1 Bitcoincash:



Domain Name?

Not yet decided.If you have anything in mind, then feel free to reply here Cheesy



Let me know, what you think about it.

Looks like after one load the cached image is showing up :c Can this be solved?
Update:The caching issue has been fixed Cheesy The images will be updated with live price after every reload.

You can see it working here: https://bitcointalk.org/index.php?topic=3485867




Really good work mate. I would like to find the more information like adding name details to show on the page and if you design the webpage with any good template you can gather for the more information designers over here.
Check vod signature, she really made good work to find the various details about this forum one page.

Since I like this work, I have merited you as well mate.
edgycorner
Full Member
***
Offline Offline

Activity: 505
Merit: 224

ψkek


View Profile
May 06, 2018, 08:33:29 PM
 #6

Domain Name?
cryptocapture
cryptotracker



Any information about the sources you gathered prices data?

adding an option to show the converted result in Bitcoin would be good.
It is using worldcoinindex.com for price.Yup, I will add that option too in the next update.


Really good work mate. I would like to find the more information like adding name details to show on the page and if you design the webpage with any good template you can gather for the more information designers over here.
Check vod signature, she really made good work to find the various details about this forum one page.

Since I like this work, I have merited you as well mate.
I will update the front page with a bootstrap design.Thanks for the merit.

I am busy with my college exams ATM :/ Will update everything once my exams are over .-.
edgycorner
Full Member
***
Offline Offline

Activity: 505
Merit: 224

ψkek


View Profile
May 07, 2018, 01:52:05 PM
Last edit: May 07, 2018, 03:17:31 PM by edgycorner
 #7

Updated a few things:

1.) Changed background color & text color of the image.
2.) Only values till 4th decimal places will be printed.
3.) The width of the image is now dynamic, depending upon the length of the string.



Things to do:
1.) Build the homepage and a link generator, with options like changing the font,color,currency,decimal place, etcetra
2.) Add a short domain name.
3.) Will try to reduce the time taken to generate images.
4.) Make it open source once everything is built & final.
Joel_Jantsen
Legendary
*
Offline Offline

Activity: 1288
Merit: 1234


Can I merit you with some Flags? 🚩


View Profile
May 07, 2018, 06:56:29 PM
 #8

This is really cool! I just tried my first image generation at http://35.226.164.123/image.php?coin=bitcoin&amount=123.So if you don't mind revealing your secret stash,how did you make it ? Does the image transformations happen on the fly or you fetch them from a server?
Either way,I'm happy to see such projects in this board.

.BitDice.               ▄▄███▄▄
           ▄▄██▀▀ ▄ ▀▀██▄▄
      ▄▄█ ▀▀  ▄▄█████▄▄  ▀▀ █▄▄
  ▄▄██▀▀     ▀▀ █████ ▀▀     ▀▀██▄▄
██▀▀ ▄▄██▀      ▀███▀      ▀██▄▄ ▀▀██
██  ████▄▄       ███       ▄▄████  ██
██  █▀▀████▄▄  ▄█████▄  ▄▄████▀▀█  ██
██  ▀     ▀▀▀███████████▀▀▀     ▀  ██
             ███████████
██  ▄     ▄▄▄███████████▄▄▄     ▄  ██
██  █▄▄████▀▀  ▀█████▀  ▀▀████▄▄█  ██
██  ████▀▀       ███       ▀▀████  ██
██▄▄ ▀▀██▄      ▄███▄      ▄██▀▀ ▄▄██
  ▀▀██▄▄     ▄▄ █████ ▄▄     ▄▄██▀▀
      ▀▀█ ▄▄  ▀▀█████▀▀  ▄▄ █▀▀
           ▀▀██▄▄ ▀ ▄▄██▀▀
               ▀▀███▀▀
        ▄▄███████▄▄
     ▄███████████████▄
    ████▀▀       ▀▀████
   ████▀           ▀████
   ████             ████
   ████ ▄▄▄▄▄▄▄▄▄▄▄ ████
▄█████████████████████████▄
██████████▀▀▀▀▀▀▀██████████
████                   ████
████                   ████
████                   ████
████                   ████
████                   ████
████▄                 ▄████
████████▄▄▄     ▄▄▄████████
  ▀▀▀█████████████████▀▀▀
        ▀▀▀█████▀▀▀
▄▄████████████████████████████████▄▄
██████████████████████████████████████
█████                            █████
█████                            █████
█████                            █████
█████                            █████
█████                     ▄▄▄▄▄▄▄▄▄▄
█████                   ▄█▀▀▀▀▀▀▀▀▀▀█▄
█████                   ██          ██
█████                   ██          ██
█████                   ██          ██
██████████████████▀▀███ ██          ██
 ████████████████▄  ▄██ ██          ██
   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ██          ██
             ██████████ ██          ██
           ▄███████████ ██████▀▀██████
          █████████████  ▀████▄▄████▀
[/]
TryNinja
Legendary
*
Online Online

Activity: 1078
Merit: 1375


CS <3


View Profile
May 07, 2018, 07:00:12 PM
Merited by edgycorner (2)
 #9

This is really cool! I just tried my first image generation at http://35.226.164.123/image.php?coin=bitcoin&amount=123.So if you don't mind revealing your secret stash,how did you make it ? Does the image transformations happen on the fly or you fetch them from a server?
Either way,I'm happy to see such projects in this board.

It's probably pretty simple.

Just fetch the Bitcoin price from an API (i.e CoinMarketCap) and calculate how much the amount is worth, then create an image with this method1] or similar.

[1] http://php.net/manual/en/function.imagettftext.php

Joel_Jantsen
Legendary
*
Offline Offline

Activity: 1288
Merit: 1234


Can I merit you with some Flags? 🚩


View Profile
May 07, 2018, 07:18:26 PM
 #10

This is really cool! I just tried my first image generation at http://35.226.164.123/image.php?coin=bitcoin&amount=123.So if you don't mind revealing your secret stash,how did you make it ? Does the image transformations happen on the fly or you fetch them from a server?
Either way,I'm happy to see such projects in this board.

It's probably pretty simple.

Just fetch the Bitcoin price from an API (i.e CoinMarketCap) and calculate how much the amount is worth, then create an image with this method1] or similar.

[1] http://php.net/manual/en/function.imagettftext.php
Ahh..I see! Never been a fan of PHP but this does sound extremely simple.So the 3rd party package is where all the magic happens. Great! Also I don't see the data being fetched from the server which actually confused me. Usually, my console or my terminal records all the API calls but when I opened the URL with the given params,I didn't see any network calls happening so I was a doubtful if it's happening on the fly. Thanks for the clarification.

.BitDice.               ▄▄███▄▄
           ▄▄██▀▀ ▄ ▀▀██▄▄
      ▄▄█ ▀▀  ▄▄█████▄▄  ▀▀ █▄▄
  ▄▄██▀▀     ▀▀ █████ ▀▀     ▀▀██▄▄
██▀▀ ▄▄██▀      ▀███▀      ▀██▄▄ ▀▀██
██  ████▄▄       ███       ▄▄████  ██
██  █▀▀████▄▄  ▄█████▄  ▄▄████▀▀█  ██
██  ▀     ▀▀▀███████████▀▀▀     ▀  ██
             ███████████
██  ▄     ▄▄▄███████████▄▄▄     ▄  ██
██  █▄▄████▀▀  ▀█████▀  ▀▀████▄▄█  ██
██  ████▀▀       ███       ▀▀████  ██
██▄▄ ▀▀██▄      ▄███▄      ▄██▀▀ ▄▄██
  ▀▀██▄▄     ▄▄ █████ ▄▄     ▄▄██▀▀
      ▀▀█ ▄▄  ▀▀█████▀▀  ▄▄ █▀▀
           ▀▀██▄▄ ▀ ▄▄██▀▀
               ▀▀███▀▀
        ▄▄███████▄▄
     ▄███████████████▄
    ████▀▀       ▀▀████
   ████▀           ▀████
   ████             ████
   ████ ▄▄▄▄▄▄▄▄▄▄▄ ████
▄█████████████████████████▄
██████████▀▀▀▀▀▀▀██████████
████                   ████
████                   ████
████                   ████
████                   ████
████                   ████
████▄                 ▄████
████████▄▄▄     ▄▄▄████████
  ▀▀▀█████████████████▀▀▀
        ▀▀▀█████▀▀▀
▄▄████████████████████████████████▄▄
██████████████████████████████████████
█████                            █████
█████                            █████
█████                            █████
█████                            █████
█████                     ▄▄▄▄▄▄▄▄▄▄
█████                   ▄█▀▀▀▀▀▀▀▀▀▀█▄
█████                   ██          ██
█████                   ██          ██
█████                   ██          ██
██████████████████▀▀███ ██          ██
 ████████████████▄  ▄██ ██          ██
   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ██          ██
             ██████████ ██          ██
           ▄███████████ ██████▀▀██████
          █████████████  ▀████▄▄████▀
[/]
TryNinja
Legendary
*
Online Online

Activity: 1078
Merit: 1375


CS <3


View Profile
May 07, 2018, 08:09:04 PM
Last edit: May 07, 2018, 09:01:17 PM by TryNinja
 #11

Ahh..I see! Never been a fan of PHP but this does sound extremely simple.So the 3rd party package is where all the magic happens. Great! Also I don't see the data being fetched from the server which actually confused me. Usually, my console or my terminal records all the API calls but when I opened the URL with the given params,I didn't see any network calls happening so I was a doubtful if it's happening on the fly. Thanks for the clarification.
Because it's made with PHP. The API calls are happening on the server-side and not on the user's browser.

The user only sees the already rendered image.

vv181
Sr. Member
****
Offline Offline

Activity: 896
Merit: 329


Africans on forum, check my profile website


View Profile WWW
May 08, 2018, 11:23:39 AM
 #12

1.) Changed background color & text color of the image.
4.) Make it open source once everything is built & final.
I'd like the new updates, now the text seems pretty clear.

Why you didn't make it as an open source project in the first place. I believe making it open source would do easily the job.



.
r

▄▄███████████▄▄
▄███████████████████▄
▄███████████████████████▄
▄██████████████████████████▄
▄██  ███████▌ ▐██████████████▄
▐██▌ ▐█▀  ▀█    ▐█▀   ▀██▀  ▀██▌
▐██  █▌ █▌ ██  ██▌ ██▌ █▌ █▌ ██▌
▐█▌ ▐█ ▐█ ▐█▌ ▐██  ▄▄▄██ ▐█ ▐██▌
▐█  ██▄  ▄██    █▄    ██▄  ▄███▌
▀████████████████████████████▀
▀██████████████████████████▀
▀███████████████████████▀
▀███████████████████▀
▀▀███████████▀▀
..


.
PLAY NOW
edgycorner
Full Member
***
Offline Offline

Activity: 505
Merit: 224

ψkek


View Profile
May 08, 2018, 11:48:10 AM
 #13

This is really cool! I just tried my first image generation at http://35.226.164.123/image.php?coin=bitcoin&amount=123.So if you don't mind revealing your secret stash,how did you make it ? Does the image transformations happen on the fly or you fetch them from a server?
Either way,I'm happy to see such projects in this board.

It's probably pretty simple.

Just fetch the Bitcoin price from an API (i.e CoinMarketCap) and calculate how much the amount is worth, then create an image with this method1] or similar.

[1] http://php.net/manual/en/function.imagettftext.php
Ahh..I see! Never been a fan of PHP but this does sound extremely simple.So the 3rd party package is where all the magic happens. Great! Also I don't see the data being fetched from the server which actually confused me. Usually, my console or my terminal records all the API calls but when I opened the URL with the given params,I didn't see any network calls happening so I was a doubtful if it's happening on the fly. Thanks for the clarification.
Yup, it is as easy as it sounds.

I'd like the new updates, now the text seems pretty clear.
Thanks :>


Why you didn't make it as an open source project in the first place. I believe making it open source would do easily the job.


The source code is very messy ATM.Even though it has just 100 lines, still it's hard to understand.
I will create a rep at github after tidying the code, as soon as I can.

Thanks for following the project guys, appreciate it!


hugeblack
Hero Member
*****
Offline Offline

Activity: 756
Merit: 576


Not your code, Not your Coins, Dld FULLNODE wallet


View Profile
May 08, 2018, 04:26:52 PM
 #14

Good work I've noticed the image's insensitivity to the case of characters:
1. You can add currency shortcuts like BTC, ETH, and LTC.
2. The image appearance time is relatively long, maybe because of my browser.
3. Edit the problem of negative values []
4. add colors if the price goes up or down.
I do not know, but it may be possible to update values using the script rather than manually updating

edgycorner
Full Member
***
Offline Offline

Activity: 505
Merit: 224

ψkek


View Profile
May 10, 2018, 10:18:28 AM
 #15

Looks like I have exhausted my free 300$ google credits .-.

Will git the project and will add the domain, once I get time(4~5 days).
eternalgloom
Legendary
*
Offline Offline

Activity: 1652
Merit: 1212



View Profile WWW
May 10, 2018, 10:53:25 AM
 #16

This is something really useful and I've been looking for something like this to use in my Steemit posts.
Looking forward to you setting up a decent website to offer this as a service!

Too bad I can't see the images, wish someone would have posted a screenshot Tongue

edgycorner
Full Member
***
Offline Offline

Activity: 505
Merit: 224

ψkek


View Profile
May 28, 2018, 05:03:43 PM
 #17

Update

I have shifted the project to openshift, and the updated the post with the new URL
http://liveimage-liveimage.193b.starter-ca-central-1.openshiftapps.com/image.php?coin=NAME

It is too long to be remembered ATM, will update with a domain soon.
Added an option of currency too, /image.php?coin=COIN&currency=CURRENCY
Currency can be usd,aud,inr,cad,gbp,krw,jpy,rub, etcetra. PM me if you can't generate image using your currency.
You can even use btc(for bitcoin); eth(ether) as currency.

You can view the code here https://github.com/edgycorner/Coin-Price-Image-generator/

The price is now fetched from coingecko.

Please let me know, if you find any problem.Thanks!




cpoer2011
Full Member
***
Offline Offline

Activity: 560
Merit: 108



View Profile
June 04, 2018, 10:36:05 PM
 #18

That's a great bitcoin and Altcoins live image generator you have made. I like it. You have done a great job by making it. Thanks for your effort. You have nailed it. Smiley
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!