项目作者: ktrue

项目描述 :
United Kingdom earthquake list from British Geological Survey
高级语言: PHP
项目地址: git://github.com/ktrue/BGS-earthquake.git
创建时间: 2019-05-03T22:29:21Z
项目社区:https://github.com/ktrue/BGS-earthquake

开源协议:GNU General Public License v3.0

下载


United Kingdom Earthquake list from UK-BGS

Documentation on how to customize the script is in comments contained in the source and replicated below.

For anywhere in the United Kingdom, you just have to change $myLat and $myLong to your station’s decimal latitude and longitude to see it work in your area. Defaults are for earthquakes within a 500 km radius. This script uses data from British Geological Survey website and returns earthquake activity over the last 30 days.

BGS data is used with permission as long as the attribution built into the script displays with the script output.

Script settings

  1. // settings:
  2. // set $ourTZ to your time zone
  3. // other settings are optional
  4. //
  5. // cacheName is name of file used to store cached USGS webpage
  6. //
  7. //
  8. $ourTZ = "Europe/London"; //NOTE: this *MUST* be set correctly to
  9. // translate UTC times to your LOCAL time for the displays.
  10. // http://saratoga-weather.org/timezone.txt has the list of timezone names
  11. // pick the one that is closest to your location and put in $ourTZ
  12. // also available is the list of country codes (helpful to pick your zone
  13. // from the timezone.txt table
  14. // http://saratoga-weather.org/country-codes.txt : list of country codes
  15. $myLat = '51.417';
  16. $myLong = '-0.434';
  17. $highRichter = "3.0"; //change color for quakes >= this magnitude
  18. // pick a format for the time to display ..uncomment one (or make your own)
  19. //$timeFormat = 'D, Y-m-d H:i:s T'; // Fri, 2006-03-31 14:03:22 TZone
  20. //$timeFormat = 'D, Y-M-d H:i:s T'; // Fri, 31-Mar-2006 14:03:22 TZone
  21. $timeFormat = 'H:i:s T D, d-M-y'; // 14:03:22 TZone Fri, 31-Mar-06
  22. $cacheFileDir = './'; // default cache file directory
  23. $cacheName = "quakesUK.txt"; // used to store the file so we don't have to
  24. // fetch it each time
  25. $refetchSeconds = 1800; // refetch every nnnn seconds
  26. // end of settings

Sample output

sample output