3/16/2024 0 Comments Geobyte ip locator![]() r (radius):When following a city location code, cause the script to include all surrounding cities out to the given distance. The default is to re-direct the user to a page of the same name as the matching location code in the “pages” parameter. Targetpage: Sets the target page that the user will be re-directed to. Default is 0 seconds (do not wait).-1= Do not re-direct (allows you to perform your own re-direct to any page, see example) The default is html.Īfter:Specifies how long to wait before re-directing the user. (Alternatively, you can also direct to any specific url – click here to see the sample below.)Įxt:Specifies the file extension of the page you wish to re-direct to. Note: The order of precedence is city, region, country, meaning a city match overrides region, and a region match overrides country. For example: geobyteslocationcode would re-direct visitors from the city of geobytescity to a page called geobyteslocationcode.html, geobytesinternetgeobytescode would re-direct visitors from the geobytesregion region to a page called geobytesinternetgeobytescode.html, while geobytesinternet would re-direct visitors from the country of geobytescountry to a page called geobytesinternet.html. Pages:Specifies the page that a person will be re-directed to based on their location. Welcome to visitors from “+sGeobytesCity+”, “+sGeobytesCountry) Further, it can also be used via the provided Geobytes’ JavaScript Variables to insert localized geographic content into a web page or JavaScript. Note: There is no need to install any special software on your web server. This JavaScript redirection tool is ideal for internet users that wish to redirect browsers based on their City, Region or Country, using Geobytes’ IP Address map technology. add_option( '-timezone', help = 'print the timezone', action = 'store_const', const = '%(timezone)d', dest = 'format')Ĭustom_group.GeoDirection is a free service that dynamically redirects internet users based on their geographic location. add_option( '-region', help = 'print the region', action = 'store_const', const = '%(region)s', dest = 'format')īasic_group. add_option( '-longitude', help = 'print the longitude', action = 'store_const', const = '%(longitude)f', dest = 'format')īasic_group. add_option( '-latitude', help = 'print the latitude', action = 'store_const', const = '%(latitude)f', dest = 'format')īasic_group. add_option( '-iso3', help = 'print the 3-letter ISO country code', action = 'store_const', const = '%(iso3)s', dest = 'format')īasic_group. add_option( '-iso2', help = 'print the 2-letter ISO country code', action = 'store_const', const = '%(iso2)s', dest = 'format')īasic_group. add_option( '-internet', help = 'print the internet country code', action = 'store_const', const = '%(internet)s', dest = 'format')īasic_group. add_option( '-icbm', help = 'print the latitude and longitude equivalent to -format="%(latitude)f, %(longitude)f"', action = 'store_const', const = "%(latitude), %(longitude)", dest = 'format')īasic_group. add_option( '-country', help = 'print the country', action = 'store_const', const = '%(country)s', dest = 'format')īasic_group. add_option( '-city', help = 'print the city name', action = 'store_const', const = '%(city)s', dest = 'format')īasic_group. add_option( '-certainty', help = 'print \'s certainty about the location', action = 'store_const', const = '%(certainty)d', dest = 'format')īasic_group. add_option( '-help-format', help = 'describe valid format strings', action = 'callback', callback = formathelp)īasic_group. set_defaults( format = """%(latitude)f, %(longitude)f""") OptionGroup( parser, "Custom output options") ![]() OptionGroup( parser, "Basic output options")Ĭustom_group = optparse. If no IP addresses are specified, read IP addresses, one per line, from standard input.""")īasic_group = optparse. ![]() If no format is specified, print latitude and longitude. Options are mutually exclusive only the last one specified will take effect. OptionParser( usage = """usage: %prog IP Locationcode longitude region regionid timezoneĪs an example, -format="%%(latitude)f, %%(longitude)f" is equivalent to -icbm""" Where c is a conversion type (a la python or printf) andĬertainty city cityid code country countryidįips internet ipaddress iso2 iso3 ison latitude Print """Format strings may include variables of the form %(varname)c, read())ĭef formathelp( opt, ostr, v, p, * a, ** kwa): # this is public domain, there is no warranty, share and enjoy ![]() Also note that this script does no error checking. # Note that the free-of-charge geobytes API only allows 20 requests # geographic location for a particular IP address # geo-ip.py uses the API to find the probable ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |