<?php
/*
منبع این سورس کانال @MahdyBots نمیباشد
منبع در خروجی ذکر شده است
در صورت بروز مشکل میتوانید به پیوی نویسنده مراجعه کنید
*/
error_reporting(0);
header('Content-Type: application/json; charset=utf-8');

$dollar2  = file_get_contents("https://www.tgju.org/profile/price_dollar_rl");
$euro2    = file_get_contents("https://www.tgju.org/profile/price_eur");
$pound2   = file_get_contents("https://www.tgju.org/profile/price_gbp");
$derham2  = file_get_contents("https://www.tgju.org/profile/price_aed");
$lira2    = file_get_contents("https://www.tgju.org/profile/price_try");
$franc2   = file_get_contents("https://www.tgju.org/profile/price_chf");
$ruble2   = file_get_contents("https://www.tgju.org/profile/price_rub");
$riyal2   = file_get_contents("https://www.tgju.org/profile/price_sar");
$dinar2   = file_get_contents("https://www.tgju.org/profile/price_kwd");
$afghani2 = file_get_contents("https://www.tgju.org/profile/price_afn");
$yuan2    = file_get_contents("https://www.tgju.org/profile/price_cny");

preg_match_all('#<td class="text-left">(.*?)</td>#',$dollar2,$dollar1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$euro2,$euro1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$pound2,$pound1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$derham2,$derham1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$lira2,$lira1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$franc2,$franc1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$ruble2,$ruble1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$riyal2,$riyal1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$dinar2,$dinar1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$afghani2,$afghani1);
preg_match_all('#<td class="text-left">(.*?)</td>#',$yuan2,$yuan1);

$dollar         = $dollar1[1][0];
$euro           = $euro1[1][0];
$pound          = $pound1[1][0];
$derham         = $derham1[1][0];
$lira           = $lira1[1][0];
$franc          = $franc1[1][0];
$ruble          = $ruble1[1][0];
$riyal          = $riyal1[1][0];
$dinar          = $dinar1[1][0];
$afghani        = $afghani1[1][0];
$yuan           = $yuan1[1][0];


echo json_encode([
    'ok' => true,
    'writer'  => '@Dev_Data',
    'channel' => '@DataTm',
    'result'  => [
    'price'   => 'RIYAL',
    'Dollar'  => $dollar,
    'Euro'    => $euro,
    'Pound'   => $pound,
    'Derham'  => $derham,
    'Lira'    => $lira,
    'Franc'   => $franc,
    'Ruble'   => $ruble,
    'Riyal'   => $riyal,
    'Dinar'   => $dinar,
    'Afghani' => $afghani,
    'Yuan'    => $yuan,
]],448);

