Search the Community

Showing results for tags 'Parsing'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RAGE Multiplayer
    • Announcements
    • Discussion
    • Suggestions
    • RDR2 Multiplayer
  • Scripting
    • Scripting
    • Resources
  • Community
    • Support
    • Servers
    • Media Gallery
  • Non-English
    • Русский - Russian
    • Français - French
    • Deutsch - German
    • Espanol - Spanish
    • Română - Romanian
    • Portuguesa - Portuguese
    • Polski - Polish

Categories

  • Scripts
  • Gamemodes
  • Libraries
  • Plugins
  • Maps
  • Tools

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Facebook


Youtube


Skype


Web


VK

Found 1 result

  1. Доброго времени суток. Хочу представить пример парсинга мастер-листа и получения информации о вашем сервере. Скриншот: Код на PHP: $ip = '91.76.227.40'; // Ip адрес сервера $port = 22005; // Port сервера $ch = curl_init('https://ml.rage.mp/servers'); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); $resp = curl_exec( $ch ); curl_close( $ch ); $resp = json_decode($resp , true); foreach($resp as $val) { if($val['ip'] == $ip and $val['port'] == $port) { echo 'PHP<hr>Id: '.$val['_id']; echo '<br>Название: '.$val['name']; echo '<br>Слотов: '.$val['slots']; echo '<br>Игроков: '.$val['players']; echo '<br>Uptime: '.$val['uptime']; break; } } Код на JavaScript: var ip = '91.76.227.40', // Ip адрес сервера port = 22005; // Port сервера $.getJSON('https://ml.rage.mp/servers', function(data) { $.each(data, function(key, val) { if(ip == val.ip && port == val.port) { document.write('JavaScript<hr>Id: '+val._id); document.write('<br>Название: '+val.name); document.write('<br>Слотов: '+val.slots); document.write('<br>Игроков: '+val.players); document.write('<br>Uptime: '+val.uptime); return false; } }); }); Библиотека JQuery обязательна!