Tylor Eddy Posted July 7, 2013 Report Share Posted July 7, 2013 G'day Guys, I've been fidding around with METAR information, and have managed to get a working script of the VATSIM metar information. Best part about it is that there is NO iframes! Here is a quick shot to show you what it looks like For Departure Airport: <?php $metar = $_POST['metar']; $url = 'http://metar.vatsim.net/'.$schedule->depicao.''; $page = file_get_contents($url); echo $page; ?> For Arrival Airport: <?php $metar = $_POST['metar']; $url = 'http://metar.vatsim.net/'.$schedule->arricao.''; $page = file_get_contents($url); echo $page; ?> Hopefully you guys find this valuable 4 Quote Link to comment Share on other sites More sharing options...
BaRBeR Posted July 7, 2013 Report Share Posted July 7, 2013 Thanks mate. 1 Quote Link to comment Share on other sites More sharing options...
Fernando Posted July 7, 2013 Report Share Posted July 7, 2013 Tylor Eddy, Very nice!!! Thank you! 1 Quote Link to comment Share on other sites More sharing options...
bteixeira Posted February 18, 2014 Report Share Posted February 18, 2014 Hi and thanks. In what page do you change the code? Quote Link to comment Share on other sites More sharing options...
poole3003 Posted August 24, 2014 Report Share Posted August 24, 2014 and where am i inserting this Quote Link to comment Share on other sites More sharing options...
ln-asm Posted August 31, 2014 Report Share Posted August 31, 2014 You can add the code where ever you want it to be displayed. For anyone using this code: be aware, Vatsim is rather strict when it comes to downloading data from their servers, and with this code, every metar will be downloaded every time someone accesses the page. If you have quite some traffic to your site, they'll easily block your server's access to download from Vatsim, so you might want to consider downloading and save the data on your server, and then have a script check if your local file is older than x minutes, and if it is, redownload. It's not too difficult to set up, and all you need can be found by a simple search (I don't have access to my FTP at the moment so I can't post my code) Have a read in the Vatsim forums as well: http://forums.vatsim.net/viewtopic.php?f=68&t=65859 Anders Quote Link to comment Share on other sites More sharing options...
freshJet Posted August 31, 2014 Report Share Posted August 31, 2014 For the non-members: If you utilise the VATSIM METAR system on your website, please have a read of my post regarding the options available to you:http://forums.vatsim...hp?f=68&t=65858 Specifically please consider how many concurrent requests you are making and how often. The IPs below have been flagged as having make grossly excessive numbers of requests to the METAR system. By this I'm talking in the tens of thousands of requests per day. Considering you can download the entire METAR file in a single request and that METARs don't update more than about once every 30 mins, you can have all the METARs available to you with 48 requests per day. The record was hit last night, I won't single out the IP, but it was 99,904 individual requests in 24 hours! If your ARE in the list If your IP is below you need to re-think how you are calling the METARs and use the ability to obtain more than one at once, if you aren't already. See my post for more details. From this time next week, I will start blocking IPs on this list that continue with "excessive" usage. Feel free to get in touch with me if you recognise your IP and would like me to hold off banning it while you make the appropriate changes. If you AREN'T in the list Please have a look anyway to make sure you are following the guidance in my post. Those I've listed below are requesting in the tens of thousands and therefore I've flagged as "grossly excessive". There are still many many sites making an excessive number of requests that I haven't listed below. Above all, please keep in mind that it's not just you using the system and that we want to keep it available to everyone. Thanks for your cooperation ------ 101.165.123.94 109.152.30.23 119.181.196.253 121.214.207.15 128.68.103.32 134.117.250.14 151.224.165.177 173.168.164.239 179.197.148.51 179.236.68.51 186.244.65.72 186.59.153.154 186.59.219.242 186.66.71.95 186.90.26.249 190.213.227.80 193.80.83.17 193.83.62.198 2.219.31.11 202.156.9.10 212.83.134.11 212.83.134.8 217.122.54.179 24.177.217.208 24.41.167.220 31.209.47.229 41.17.242.78 46.117.61.240 46.39.36.138 5.65.94.212 58.6.156.2 62.129.239.116 67.3.216.160 69.80.37.100 71.188.84.71 71.92.161.212 73.178.115.165 76.11.67.0 76.69.139.128 77.57.18.47 78.14.9.127 81.251.202.245 81.39.251.89 82.55.215.63 83.162.242.118 84.113.101.240 84.115.244.4 84.146.230.75 84.146.234.100 86.134.154.127 86.146.43.65 86.169.95.252 86.201.88.226 88.181.163.7 88.65.181.169 89.144.217.195 89.151.134.92 89.178.219.172 89.216.236.150 89.227.116.51 89.227.222.125 90.217.68.196 90.34.91.86 92.104.43.160 92.133.69.109 92.237.208.32 92.74.241.113 92.74.243.178 93.93.112.27 94.159.246.194 94.185.176.218 94.216.166.63 94.254.119.209 94.38.138.98 94.38.139.1 95.26.131.229 Quote Link to comment Share on other sites More sharing options...
freshJet Posted September 1, 2014 Report Share Posted September 1, 2014 I retreive directly from NOAA in most cases: http://weather.noaa.gov/pub/data/observations/metar/stations/ICAO.TXT Albeit it does require some extra coding to remove the timestamp but useful if you use a function to call it whenever you need it. Quote Link to comment Share on other sites More sharing options...
ChrisTaylor Posted September 2, 2014 Report Share Posted September 2, 2014 where do you put this in? Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted September 3, 2014 Members Report Share Posted September 3, 2014 For Departure Airport: <?php $metar = $_POST['metar']; $url = 'http://weather.noaa.gov/pub/data/observations/metar/stations/'.$schedule->depicao.'.txt''; $page = file_get_contents($url); echo $page; ?> For Arrival Airport: <?php $metar = $_POST['metar']; $url = 'http://weather.noaa.gov/pub/data/observations/metar/stations'.$schedule->arricao.'.txt''; $page = file_get_contents($url); echo $page; ?> Quote Link to comment Share on other sites More sharing options...
hurkulez Posted September 16, 2014 Report Share Posted September 16, 2014 Is there a way to get the data every hour, and have it post it to a DB @ phpvms_metars. Then call it from the local DB? Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted September 17, 2014 Members Report Share Posted September 17, 2014 there is no need to do that you can save the txt file on your server and grab it from there i might be able to give you a script 2morrow as i am still at work Quote Link to comment Share on other sites More sharing options...
hurkulez Posted January 16, 2015 Report Share Posted January 16, 2015 Sry for the long wait for a reply. Writing code for a new VA... Quote Link to comment Share on other sites More sharing options...
Moderators shakamonkey88 Posted April 30, 2018 Moderators Report Share Posted April 30, 2018 On 17/09/2014 at 9:54 PM, Vangelis said: there is no need to do that you can save the txt file on your server and grab it from there i might be able to give you a script 2morrow as i am still at work Hey Vangelis, I know this post is old but I'm wondering whether you wrote a script for this? Thanks, Pete Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted May 1, 2018 Members Report Share Posted May 1, 2018 No I did not Quote Link to comment Share on other sites More sharing options...
Moderators shakamonkey88 Posted May 1, 2018 Moderators Report Share Posted May 1, 2018 No problem. We’re now using checkwx and their API. Will try out alternative PHP cache using apc_store and apc_fetch. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 4, 2018 Administrators Report Share Posted May 4, 2018 On 5/1/2018 at 4:13 PM, shakamonkey88 said: No problem. We’re now using checkwx and their API. Will try out alternative PHP cache using apc_store and apc_fetch. CheckWX is real easy to use. I took a super old PHP parser and updating it to run with the latest PHP: https://github.com/nabeelio/phpvms/blob/master/app/Support/Metar.php This is the original: https://github.com/hsdn/metar-taf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.