Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
  1. function ocean(lat,lng) {
  2. /*
     returns the ocean or sea for the given latitude/longitude
    */
  3.   var url = "http://ws.geonames.org/oceanJSON?lat="+lat+"&lng="+lng;
  4.   var response = UrlFetchApp.fetch(url);
  5.   var str = eval('(' + response.getContentText() + ')').ocean.name;
  6.   return str;
  7. }
  8.  
  9. function countryCode(lat,lng) {
  10. /*
     returns the iso country code of any given latitude/longitude
    */
  11.   var url = "http://ws.geonames.org/countryCode?lat="+lat+"&lng="+lng;
  12.   var response = UrlFetchApp.fetch(url);
  13.   var str = response.getContentText();
  14.   return str;
  15. }
  16.  




Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2017