Kripto Para Fiyatlarını Takip Etmek

klamhat

Üye
8 Ocak 2011
103
45
Merhaba.

Bugün örnek bir web sitesi ile karşınızdayım.

Bu web sitesinde kripto paraların fiyatlarını ve çeşitli bazı verileri görüntüleyebiliyoruz.

Kendim kodladım...

Bir api servisi (coincap) kullanarak istenilen kripto parayla ilgili verileri apiden çekip yazdırıyoruz.

Görseller ;


5kwyywy.png


4mm9qbl.png


4mg6wv1.png


Kodlar ;

index.php

PHP:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Klamhat Crypto</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-image: url('arkaplan.png');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }

        .container {
            max-width: 800px;
            height: 700px;
            margin: 50px auto;
            background-color: rgba(255, 255, 255, 0.7);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            background-color: rgba(255, 255, 255, 0.7);
            overflow: hidden;
        }

        h1 {
            text-align: center;
        }

        #search {
            text-align: center;
            margin-bottom: 20px;
        }

        #search input[type="text"] {
            padding: 13px;
            height: 12px;
            border: 1px solid #ccc;
            border-radius: 4px;
            margin-right: 10px;
        }

        #search button {
            padding: 10px 20px;
            background-color: black;
            color: #fff;
            font-size: 14px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        #prices {
            padding: 20px;
            border-top: 1px solid #ccc;
        }

        #prices h2 {
            margin-top: 0;
            font-size: 24px;
            color: green;
        }

        #prices p {
            margin: 5px 0;
            font-size: 18px;
        }

        #prices ul {
            list-style-type: none;
            padding: 0;
        }

        #prices li {
            margin-bottom: 5px;
        }

        .disclaimer {
            text-align: center;
            margin-top: 20px;
            font-size: 18px;
            color: black;
        }
    </style>
    <script>
        window.onload = function() {
            var coinName = document.querySelector('#prices h2').textContent;
            document.title = "Klamhat Crypto | " + coinName;
        }
    </script>
</head>
<body>
    <div class="container">
        <h1>Klamhat Crypto Tracking</h1>
        <div id="search">
            <form method="post">
                <input type="text" name="coin" placeholder="Write a cryptocurrency">
                <button type="submit" name="submit">Search</button>
            </form>
        </div>
        <div id="prices">
            <?php include 'fetch_prices.php'; ?>
        </div>
        <p class="disclaimer">Data may lag, it is important to check different sources for correct analysis!</p>
    </div>
</body>
</html>


fetch_prices.php
PHP:
<?php
error_reporting(E_ERROR | E_PARSE);
if(isset($_POST['submit'])) {
    $coin = $_POST['coin'];
    $url = "https://api.coincap.io/v2/assets/$coin";
    $data = @json_decode(file_get_contents($url));

    if ($data && isset($data->data) && $data->data) {
        echo "<h2>{$data->data->name} ({$data->data->symbol})</h2>";
        echo "<p>Price: $ <strong>" . number_format($data->data->priceUsd, 2, '.', ',') . "</strong></p>";
        echo "<p>24 Hour Change: <strong>{$data->data->changePercent24Hr}%</strong></p>";

        echo "<h3>Other Information:</h3>";
        echo "<ul>";
        foreach ($data->data as $key => $value) {
            if (!is_object($value) && !is_array($value)) {

                $formattedValue = is_numeric($value) ? number_format($value, 2, '.', ',') : $value;
                if ($key == 'priceUsd') {
                    echo "<li><strong>Price:</strong> $formattedValue $</li>";
                } elseif ($key == 'changePercent24Hr') {
                    echo "<li><strong>24 Hour Change:</strong> $formattedValue%</li>";
                } elseif ($key == 'marketCapUsd') {
                    echo "<li><strong>Market Cap:</strong> $formattedValue $</li>";
                } elseif ($key == 'volumeUsd24Hr') {
                    echo "<li><strong>24 Hour Volume:</strong> $formattedValue $</li>";
                } elseif ($key == 'supply') {
                    echo "<li><strong>Supply:</strong> $formattedValue $</li>";
                } elseif ($key == 'maxSupply') {
                    echo "<li><strong>Max Supply:</strong> $formattedValue $</li>";
                } elseif ($key == 'rank') {
                    echo "<li><strong>Rank:</strong> $formattedValue</li>";
                } elseif ($key == 'id') {
                    echo "<li><strong>ID:</strong> $formattedValue</li>";
                } else {
                    echo "<li><strong>$key:</strong> $formattedValue</li>";
                }
            }
        }
        echo "</ul>";
    } else {
        echo "<p style='color: red;'>The cryptocurrency you entered could not be found. Please enter a valid cryptocurrency name.</p>";
    }
}
?>
 

EX

Moderatör
29 Mar 2020
1,909
5
1,249
Güzel proje, geliştirilmesi dileği ile. Eline sağlık.
 

Yagami Light0

Katılımcı Üye
5 May 2023
720
5
330
23
Merhaba.

Bugün örnek bir web sitesi ile karşınızdayım.

Bu web sitesinde kripto paraların fiyatlarını ve çeşitli bazı verileri görüntüleyebiliyoruz.

Kendim kodladım...

Bir api servisi (coincap) kullanarak istenilen kripto parayla ilgili verileri apiden çekip yazdırıyoruz.

Görseller ;


5kwyywy.png


4mm9qbl.png


4mg6wv1.png


Kodlar ;

index.php

PHP:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Klamhat Crypto</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-image: url('arkaplan.png');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }

        .container {
            max-width: 800px;
            height: 700px;
            margin: 50px auto;
            background-color: rgba(255, 255, 255, 0.7);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            background-color: rgba(255, 255, 255, 0.7);
            overflow: hidden;
        }

        h1 {
            text-align: center;
        }

        #search {
            text-align: center;
            margin-bottom: 20px;
        }

        #search input[type="text"] {
            padding: 13px;
            height: 12px;
            border: 1px solid #ccc;
            border-radius: 4px;
            margin-right: 10px;
        }

        #search button {
            padding: 10px 20px;
            background-color: black;
            color: #fff;
            font-size: 14px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        #prices {
            padding: 20px;
            border-top: 1px solid #ccc;
        }

        #prices h2 {
            margin-top: 0;
            font-size: 24px;
            color: green;
        }

        #prices p {
            margin: 5px 0;
            font-size: 18px;
        }

        #prices ul {
            list-style-type: none;
            padding: 0;
        }

        #prices li {
            margin-bottom: 5px;
        }

        .disclaimer {
            text-align: center;
            margin-top: 20px;
            font-size: 18px;
            color: black;
        }
    </style>
    <script>
        window.onload = function() {
            var coinName = document.querySelector('#prices h2').textContent;
            document.title = "Klamhat Crypto | " + coinName;
        }
    </script>
</head>
<body>
    <div class="container">
        <h1>Klamhat Crypto Tracking</h1>
        <div id="search">
            <form method="post">
                <input type="text" name="coin" placeholder="Write a cryptocurrency">
                <button type="submit" name="submit">Search</button>
            </form>
        </div>
        <div id="prices">
            <?php include 'fetch_prices.php'; ?>
        </div>
        <p class="disclaimer">Data may lag, it is important to check different sources for correct analysis!</p>
    </div>
</body>
</html>


fetch_prices.php
PHP:
<?php
error_reporting(E_ERROR | E_PARSE);
if(isset($_POST['submit'])) {
    $coin = $_POST['coin'];
    $url = "https://api.coincap.io/v2/assets/$coin";
    $data = @json_decode(file_get_contents($url));

    if ($data && isset($data->data) && $data->data) {
        echo "<h2>{$data->data->name} ({$data->data->symbol})</h2>";
        echo "<p>Price: $ <strong>" . number_format($data->data->priceUsd, 2, '.', ',') . "</strong></p>";
        echo "<p>24 Hour Change: <strong>{$data->data->changePercent24Hr}%</strong></p>";

        echo "<h3>Other Information:</h3>";
        echo "<ul>";
        foreach ($data->data as $key => $value) {
            if (!is_object($value) && !is_array($value)) {

                $formattedValue = is_numeric($value) ? number_format($value, 2, '.', ',') : $value;
                if ($key == 'priceUsd') {
                    echo "<li><strong>Price:</strong> $formattedValue $</li>";
                } elseif ($key == 'changePercent24Hr') {
                    echo "<li><strong>24 Hour Change:</strong> $formattedValue%</li>";
                } elseif ($key == 'marketCapUsd') {
                    echo "<li><strong>Market Cap:</strong> $formattedValue $</li>";
                } elseif ($key == 'volumeUsd24Hr') {
                    echo "<li><strong>24 Hour Volume:</strong> $formattedValue $</li>";
                } elseif ($key == 'supply') {
                    echo "<li><strong>Supply:</strong> $formattedValue $</li>";
                } elseif ($key == 'maxSupply') {
                    echo "<li><strong>Max Supply:</strong> $formattedValue $</li>";
                } elseif ($key == 'rank') {
                    echo "<li><strong>Rank:</strong> $formattedValue</li>";
                } elseif ($key == 'id') {
                    echo "<li><strong>ID:</strong> $formattedValue</li>";
                } else {
                    echo "<li><strong>$key:</strong> $formattedValue</li>";
                }
            }
        }
        echo "</ul>";
    } else {
        echo "<p style='color: red;'>The cryptocurrency you entered could not be found. Please enter a valid cryptocurrency name.</p>";
    }
}
?>
Bende yazmisdim boyle bir sey js ile bende grafikleri falan vardi , ancak api cektigi icin gecikmeler oluyordu . Yani benim yazdigim gercek hayatta kullanim icin kotuydu o yuzden devam etmedim . Sana basarilar dilerim, eline saglik, devamini getirmen dilegi ile
 

Butcherb3y

Uzman üye
1 Eyl 2022
1,617
7
1,199
Anıtkabir
Merhaba.

Bugün örnek bir web sitesi ile karşınızdayım.

Bu web sitesinde kripto paraların fiyatlarını ve çeşitli bazı verileri görüntüleyebiliyoruz.

Kendim kodladım...

Bir api servisi (coincap) kullanarak istenilen kripto parayla ilgili verileri apiden çekip yazdırıyoruz.

Görseller ;


5kwyywy.png


4mm9qbl.png


4mg6wv1.png


Kodlar ;

index.php

PHP:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Klamhat Crypto</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-image: url('arkaplan.png');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }

        .container {
            max-width: 800px;
            height: 700px;
            margin: 50px auto;
            background-color: rgba(255, 255, 255, 0.7);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            background-color: rgba(255, 255, 255, 0.7);
            overflow: hidden;
        }

        h1 {
            text-align: center;
        }

        #search {
            text-align: center;
            margin-bottom: 20px;
        }

        #search input[type="text"] {
            padding: 13px;
            height: 12px;
            border: 1px solid #ccc;
            border-radius: 4px;
            margin-right: 10px;
        }

        #search button {
            padding: 10px 20px;
            background-color: black;
            color: #fff;
            font-size: 14px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        #prices {
            padding: 20px;
            border-top: 1px solid #ccc;
        }

        #prices h2 {
            margin-top: 0;
            font-size: 24px;
            color: green;
        }

        #prices p {
            margin: 5px 0;
            font-size: 18px;
        }

        #prices ul {
            list-style-type: none;
            padding: 0;
        }

        #prices li {
            margin-bottom: 5px;
        }

        .disclaimer {
            text-align: center;
            margin-top: 20px;
            font-size: 18px;
            color: black;
        }
    </style>
    <script>
        window.onload = function() {
            var coinName = document.querySelector('#prices h2').textContent;
            document.title = "Klamhat Crypto | " + coinName;
        }
    </script>
</head>
<body>
    <div class="container">
        <h1>Klamhat Crypto Tracking</h1>
        <div id="search">
            <form method="post">
                <input type="text" name="coin" placeholder="Write a cryptocurrency">
                <button type="submit" name="submit">Search</button>
            </form>
        </div>
        <div id="prices">
            <?php include 'fetch_prices.php'; ?>
        </div>
        <p class="disclaimer">Data may lag, it is important to check different sources for correct analysis!</p>
    </div>
</body>
</html>


fetch_prices.php
PHP:
<?php
error_reporting(E_ERROR | E_PARSE);
if(isset($_POST['submit'])) {
    $coin = $_POST['coin'];
    $url = "https://api.coincap.io/v2/assets/$coin";
    $data = @json_decode(file_get_contents($url));

    if ($data && isset($data->data) && $data->data) {
        echo "<h2>{$data->data->name} ({$data->data->symbol})</h2>";
        echo "<p>Price: $ <strong>" . number_format($data->data->priceUsd, 2, '.', ',') . "</strong></p>";
        echo "<p>24 Hour Change: <strong>{$data->data->changePercent24Hr}%</strong></p>";

        echo "<h3>Other Information:</h3>";
        echo "<ul>";
        foreach ($data->data as $key => $value) {
            if (!is_object($value) && !is_array($value)) {

                $formattedValue = is_numeric($value) ? number_format($value, 2, '.', ',') : $value;
                if ($key == 'priceUsd') {
                    echo "<li><strong>Price:</strong> $formattedValue $</li>";
                } elseif ($key == 'changePercent24Hr') {
                    echo "<li><strong>24 Hour Change:</strong> $formattedValue%</li>";
                } elseif ($key == 'marketCapUsd') {
                    echo "<li><strong>Market Cap:</strong> $formattedValue $</li>";
                } elseif ($key == 'volumeUsd24Hr') {
                    echo "<li><strong>24 Hour Volume:</strong> $formattedValue $</li>";
                } elseif ($key == 'supply') {
                    echo "<li><strong>Supply:</strong> $formattedValue $</li>";
                } elseif ($key == 'maxSupply') {
                    echo "<li><strong>Max Supply:</strong> $formattedValue $</li>";
                } elseif ($key == 'rank') {
                    echo "<li><strong>Rank:</strong> $formattedValue</li>";
                } elseif ($key == 'id') {
                    echo "<li><strong>ID:</strong> $formattedValue</li>";
                } else {
                    echo "<li><strong>$key:</strong> $formattedValue</li>";
                }
            }
        }
        echo "</ul>";
    } else {
        echo "<p style='color: red;'>The cryptocurrency you entered could not be found. Please enter a valid cryptocurrency name.</p>";
    }
}
?>
Elinize sağlık arama kısmına yazdığımız btc yi cikartiyor sanirasam oyle ise arama kısmına yazmadan direk gordigimizde çoğu btc nin bilgilerini daha güzel değil mi tek tek yazmak yerine hocam
 

klamhat

Üye
8 Ocak 2011
103
45
Elinize sağlık arama kısmına yazdığımız btc yi cikartiyor sanirasam oyle ise arama kısmına yazmadan direk gordigimizde çoğu btc nin bilgilerini daha güzel değil mi tek tek yazmak yerine hocam
Teşekkür ederim.
Aklımda ki özellik ;
Ekran da en popüler 10 kripto parayı otomatik göstermesi geriye kalanları ise arama ile göstermesi..
 

ATE$

Katılımcı Üye
9 Kas 2021
376
169
Siber Şubede geziyor.
Css
Merhaba.

Bugün örnek bir web sitesi ile karşınızdayım.

Bu web sitesinde kripto paraların fiyatlarını ve çeşitli bazı verileri görüntüleyebiliyoruz.

Kendim kodladım...

Bir api servisi (coincap) kullanarak istenilen kripto parayla ilgili verileri apiden çekip yazdırıyoruz.

Görseller ;


5kwyywy.png


4mm9qbl.png


4mg6wv1.png


Kodlar ;

index.php

PHP:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Klamhat Crypto</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-image: url('arkaplan.png');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }

        .container {
            max-width: 800px;
            height: 700px;
            margin: 50px auto;
            background-color: rgba(255, 255, 255, 0.7);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            background-color: rgba(255, 255, 255, 0.7);
            overflow: hidden;
        }

        h1 {
            text-align: center;
        }

        #search {
            text-align: center;
            margin-bottom: 20px;
        }

        #search input[type="text"] {
            padding: 13px;
            height: 12px;
            border: 1px solid #ccc;
            border-radius: 4px;
            margin-right: 10px;
        }

        #search button {
            padding: 10px 20px;
            background-color: black;
            color: #fff;
            font-size: 14px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        #prices {
            padding: 20px;
            border-top: 1px solid #ccc;
        }

        #prices h2 {
            margin-top: 0;
            font-size: 24px;
            color: green;
        }

        #prices p {
            margin: 5px 0;
            font-size: 18px;
        }

        #prices ul {
            list-style-type: none;
            padding: 0;
        }

        #prices li {
            margin-bottom: 5px;
        }

        .disclaimer {
            text-align: center;
            margin-top: 20px;
            font-size: 18px;
            color: black;
        }
    </style>
    <script>
        window.onload = function() {
            var coinName = document.querySelector('#prices h2').textContent;
            document.title = "Klamhat Crypto | " + coinName;
        }
    </script>
</head>
<body>
    <div class="container">
        <h1>Klamhat Crypto Tracking</h1>
        <div id="search">
            <form method="post">
                <input type="text" name="coin" placeholder="Write a cryptocurrency">
                <button type="submit" name="submit">Search</button>
            </form>
        </div>
        <div id="prices">
            <?php include 'fetch_prices.php'; ?>
        </div>
        <p class="disclaimer">Data may lag, it is important to check different sources for correct analysis!</p>
    </div>
</body>
</html>


fetch_prices.php
PHP:
<?php
error_reporting(E_ERROR | E_PARSE);
if(isset($_POST['submit'])) {
    $coin = $_POST['coin'];
    $url = "https://api.coincap.io/v2/assets/$coin";
    $data = @json_decode(file_get_contents($url));

    if ($data && isset($data->data) && $data->data) {
        echo "<h2>{$data->data->name} ({$data->data->symbol})</h2>";
        echo "<p>Price: $ <strong>" . number_format($data->data->priceUsd, 2, '.', ',') . "</strong></p>";
        echo "<p>24 Hour Change: <strong>{$data->data->changePercent24Hr}%</strong></p>";

        echo "<h3>Other Information:</h3>";
        echo "<ul>";
        foreach ($data->data as $key => $value) {
            if (!is_object($value) && !is_array($value)) {

                $formattedValue = is_numeric($value) ? number_format($value, 2, '.', ',') : $value;
                if ($key == 'priceUsd') {
                    echo "<li><strong>Price:</strong> $formattedValue $</li>";
                } elseif ($key == 'changePercent24Hr') {
                    echo "<li><strong>24 Hour Change:</strong> $formattedValue%</li>";
                } elseif ($key == 'marketCapUsd') {
                    echo "<li><strong>Market Cap:</strong> $formattedValue $</li>";
                } elseif ($key == 'volumeUsd24Hr') {
                    echo "<li><strong>24 Hour Volume:</strong> $formattedValue $</li>";
                } elseif ($key == 'supply') {
                    echo "<li><strong>Supply:</strong> $formattedValue $</li>";
                } elseif ($key == 'maxSupply') {
                    echo "<li><strong>Max Supply:</strong> $formattedValue $</li>";
                } elseif ($key == 'rank') {
                    echo "<li><strong>Rank:</strong> $formattedValue</li>";
                } elseif ($key == 'id') {
                    echo "<li><strong>ID:</strong> $formattedValue</li>";
                } else {
                    echo "<li><strong>$key:</strong> $formattedValue</li>";
                }
            }
        }
        echo "</ul>";
    } else {
        echo "<p style='color: red;'>The cryptocurrency you entered could not be found. Please enter a valid cryptocurrency name.</p>";
    }
}
?>
daha güzel olabilirdi ama yinede ellerine sağlık.
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.